<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml"
      xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>样机管理-详细</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=f5a12a1d">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style type="text/css">
        .user {
            height: 30px;
            line-height: 30px;
            max-height: 30px;
            float: left;
            text-align: left;
            min-width: 32px;
            padding-left: 1px;
            overflow: hidden;
            cursor: pointer;
        }

        .user:hover {
            background-color: #cfd4d1;
        }

        .userbox .select.user {
            color: #fff;
            background-color: #045B9E;
        }

        .IcoNormal {
            float: left;
            border-bottom: 0px;
            border-left: 0px;
            background-color: transparent;
            width: 16px;
            height: 16px;
            vertical-align: middle;
            border-top: 0px;
            border-right: 0px;
            background-image: url(/dist/img/upload_normal.gif);
            background-repeat: no-repeat;
            float: left;
            margin-top: 4px;
            margin-right: 5px;
            margin-left: 5px;
        }

        .progressobj {
            height: 20px;
        }

        .progressobj .delfile {
            float: left;
            margin-left: 10px;
        }

        .select {
            color: #fff;
            background-color: #045B9E;
        }

        td .sp-value {
            display: inline-block;
            padding-left: 6px;
            word-wrap: break-word;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span, .lineSpan {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        td.td-value2, td span {
            color: #2a8cec;
        }

        td.td-title, td select, td .filename, td.td-module {
            color: #333;
        }

        .table-detail-payee:nth-child(even) td.td-title {
            background-color: white;
        }

        .printDiv {
            display: none;
        }

        .close {
            position: relative;
            width: 0.15em;
            height: 0.8em;
            background: red;
            -webkit-transform: rotate(45deg);
            -moz-transform: rotate(45deg);
            -o-transform: rotate(45deg);
            -ms-transform: rotate(45deg);
            transform: rotate(45deg);
            display: inline-block;
            margin-right: 15px;
            margin-top: 5px;
        }

        .close:after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 0.15em;
            height: 0.8em;
            background: red;
            -webkit-transform: rotate(270deg);
            -moz-transform: rotate(270deg);
            -o-transform: rotate(270deg);
            -ms-transform: rotate(270deg);
            transform: rotate(270deg);
        }

        .biTian {
            position: absolute;
            color: #000;
            margin-left: -15px;
            margin-top: 2px;
        }

        div {
            overflow: hidden; /*//隐藏多余的滚动条*/
        }

        .table-detail td.td-value2 {
            padding: 1px !important;
            text-align: left !important;
        }

        .td-value2 input {
            box-shadow: inset 1px 1px 4px #333;
            height: 100%;
            padding-left: 4px !important;
        }

        .td-value2 select {
            box-shadow: inset 1px 1px 4px #333;
            height: 100% !important;
            padding-left: 4px !important;
        }

        .Hfj {
            height: 31px;
            /*margin-top: -20px*/
        }

        .webuploader-pick {
            background: url(/dist/img/fjT1.png) no-repeat 5px center;
            display: block;
            padding: 0 4px;
            height: 22px;
            line-height: 22px;
            padding-left: 15px;
            margin: 0 auto;
            width: 70px;
            margin-top: 4px;
            border-radius: 4px;
        }

        .webuploader-pick-hover {
            color: #fff !important;
            background: url(/dist/img/fjT2.png) no-repeat 5px center;
            background-color: #0F6099;

        }

        #divUploadedFiles {
            /*padding: 4px;*/
            padding-bottom: 0;
        }

        .title {
            background-color: yellow;
            color: black;
        }

        .jiaobiao3 {
            position: relative;
        }

        .jiaobiao3 i {
            display: block;
            width: 10px;
            height: 10px;
            background: url("/dist/img/newLog3.png");
            position: absolute;
            top: 0px;
            right: 0px;
        }

        .moreListData {
            position: absolute;
            top: 30px;
            z-index: 111;
            display: none;
        }

        .moreListData .item {
            width: 100%;
            height: 30px;
            line-height: 30px;
        }

        .moreListData .item span {
            margin-right: 5px;
        }

        .ui_main {
            vertical-align: top;
        }

        .bianhong {
            color: red;
        !important;
        }

        .table-detail textarea {
            height: 60px;
            width: 100%;
            border: none;
            outline: none;
            -webkit-appearance: none;
            resize: none;
            line-height: 20px;
            padding-top: 2px !important;
            padding-left: 6px;
        }

        .table-detail input[type="text"] {
            height: 100%;
        }
    </style>
</head>
<body>
<iframe id="ifAttach" style="display:none"></iframe>
<div class="div-td-content-more"><i></i></div>

<div class="layout" style="left:0px;top:0px;right:0px;bottom:0px;" id="app">
    <div class="model-picker-dropdown">
        <div class="model-select-wrap">
            <div class="model-select-tab">
                <a class="active" data-count="type">省</a><a class="" data-count="brand">市</a>
                <a data-count="model" class="">县</a>
            </div>
            <div class="model-select-content">
                <div class="model-select type" data-count="type" style="display: block;">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="item in itemPro">{{item.name}}</a>
                    </dl>
                </div>
                <div class="model-select brand" data-count="province">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="(item,i) in itemCity">{{item.name}}</a>
                    </dl>
                </div>
                <div class="model-select model" data-count="model">
                    <dl class="clearfix">
                        <a class="" :attr-id="item.id" v-for="(item,i) in itemCounty">{{item.name}}</a>
                    </dl>
                </div>
            </div>
        </div>
    </div>
    <table class="title-table printDiv" border=0 cellSpacing=0 cellPadding=0>
    </table>
    <div class="center" style="overflow:auto;overflow-x:hidden;padding-left:8px;padding-right:8px;">
        <table class="table-detail">
            <tr class="no-print">
                <td colspan="4" class=" no-print  title">基本信息</td>
            </tr>
            <tr>
                <td class="td-title"><i class="biTian">*</i>购车公司</td>
                <td class="td-value2" colspan="3">
                    <select v-if="showInput('0')" class=" td-row2 td-value" id="testCom" v-model="selectCom"
                            @change="getBran">
                        <option selected value=""></option>
                        <option v-for="itemC in itemsCom" v-bind:value="itemC.id">
                            {{itemC.name}}
                        </option>
                    </select>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.companyName}}</span>

                </td>
            </tr>
            <tr>
                <td class="td-title" style="width: 25%"><i class="biTian">*</i>品牌</td>
                <td class="td-value2" style="width: 25%">
                    <select v-if="showInput('0')" class=" td-row2 td-value" id="testBran" v-model="selectBran"
                            @change="getType">
                        <option value=""></option>
                        <option v-for="itemB in itemsBran" v-bind:value="itemB.id">{{itemB.brandName}}</option>
                        </option>
                    </select>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.brandName}}</span>
                </td>
                <td class="td-title" style="width: 25%"><i class="biTian">*</i>设备类型</td>
                <td class="td-value2" style="width: 25%">
                    <select v-if="showInput('0')" class=" td-row2 td-value" id="testType" v-model="selectType"
                            @change="getMod">
                        <!--<option id="selType" value="请选择设备类型" v-if="type=='edit'" v-bind:value="selectType">{{customer.deviceTypeName}}</option>-->
                        <option value=""></option>
                        <option v-for="itemT in itemsType" v-bind:value="itemT.id">{{itemT.name}}</option>
                    </select>
                    <span v-else class="pull-left"
                          style="margin-left: 10px">{{sampleParmsList.main.deviceTypeName}}</span>

                </td>
            </tr>
            <tr>
                <td class="td-title"><i class="biTian">*</i>型号
                    <button type="button" class="btn oaBtn btn-sm pull-right"
                            id="addmodel"
                            style="height: 22px;margin-top:5px; position: absolute;right: 0px;display:none"
                            @click="modelmanager(selectBran,selectType)">型号管理
                    </button>
                </td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="modelName" data-type='1'>
                    <select v-if="showInput('型号')" class=" td-row2 td-value" id="testMod" v-model="selectMod"
                            @change="show()">
                        <option value=""></option>
                        <option v-for="itemMo in itemsMod" v-bind:value="itemMo.id">{{itemMo.modelName}}
                        </option>
                    </select>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.modelName}}</span>

                </td>
                <td class="td-title"><i class="biTian">*</i>序列号</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.sequence"/>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.sequence}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title"><i class="biTian">*</i>吨位(吨)</td>
                <td class="td-value2">
                    <!--<input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'sampleParmsList.main.tonConfig')"
                           @focus="strFormatF($event.target,'sampleParmsList.main.tonConfig')"
                           v-onedate="fmoney(sampleParmsList.main.tonConfig)"
                    />-->
                    <span style="margin-left: 10px">{{fmoney(sampleParmsList.main.tonConfig)}}</span>
                    <!-- <span v-else class="pull-left"
                           style="margin-left: 10px">{{fmoney(sampleParmsList.main.tonConfig)}}</span>-->
                    <!--  <span style="position:absolute;left:105px;top: 0px;">吨</span>-->
                    <!--<span v-html="getConfig(sampleParmsList.main.tonConfig)"
                          style="position:absolute;left:185px;top: 0px;"></span>-->
                </td>
                <td class="td-title">配置号

                </td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="bucketType" data-type='1'>
                    <input type="text" v-if="showInput('0')" style="width: 100%;border: 0px"  v-model="sampleParmsList.main.configurationNo">
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.configurationNo}}</span>
                </td>
            </tr>
            <tr>

                <td class="td-title">铲斗类型

                </td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="bucketType" data-type='1'>
                    <select v-if="showInput('铲斗类型')" class=" td-row2 td-value" id="testBucketType" v-model="selectBucketType" @change="showBucket()">
                        <option value=""></option>
                        <option v-for="option in buckets" :value="option.bucketType">{{option.bucketType}}
                        </option>
                    </select>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.bucketType}}</span>

                </td>
                <td class="td-title">斗容
                    <button type="button" class="btn oaBtn btn-sm pull-right"
                            id="addbucket"
                            style="height: 22px;margin-top:5px; position: absolute;right: 0px;display:none"
                            @click="bucketmanager(selectBran,selectType,selectMod)">铲斗管理
                    </button>
                </td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="bucketCapacity" data-type='1'>
                    <select v-if="showInput('斗容')" class=" td-row2 td-value" id="testBucketCapacity" @change="showConfigurationNo()" v-model="selectBucketCapacity" >
                        <option value=""></option>
                        <option v-for="option in bucketCapacitys" :value="option.bucketCapacity">{{option.bucketCapacity}}
                        </option>
                    </select>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.bucketCapacity}}</span>

                </td>
            </tr>
            <tr id="con" style="display: none">
                <td class="td-title">出库合同</td>
                <td colspan="3">
                    <span id="contract" class="pull-left" style="margin-left: 10px"></span>
                    <a id="selContract" @click="selContract(sampleParmsList.main.modelName)" href="javascript:void(0)"
                       class="pull-right" style="margin-right: 190px"><span style="font-size: 14px"
                                                                            id="show">选择合同</span></a>
                    <input id="contractId" type="text" style="display: none">
                </td>
            </tr>
            <tr>
                <td class="td-title">生产日期</td>
                <td class="td-value2 moreList " data-table="t_dvc_sample" data-column="productionDate" data-type='1'>
                    <input class="text-left" @focus="showDatePicker($event,'main','productionDate')"
                           v-if="showInput('生产日期')" v-model="sampleParmsList.main.productionDate"
                           style="width: 100%;border: 0px" type="text"
                    />
                    <span v-else class="pull-left "
                          style="margin-left: 10px;">{{sampleParmsList.main.productionDate}}</span>
                </td>
                <td class="td-title"><i class="biTian">*</i>状态</td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="state" data-type='1'>
                    <select v-if="showInput('状态')" class=" td-row2 td-value" id="testState" v-model="selectState"
                            @change="showCon" class="form-control select2 exhibitionTypeSelect">
                        <option value=""></option>
                        <!--<option value="未发订单">未发订单</option>-->
                        <option v-if="selectStock=='直发客户交机'&&pageType=='add'" value="交付在途">交付在途</option>
                        <option v-if="pageType=='add'" value="提车在途">提车在途</option>
                        <option v-else="pageType=='edit'" v-for="option in state" :value="option.value">
                            {{option.value}}
                        </option>
                        <!--<option v-else v-for="option in state" :value="option.value">{{option.value}}</option>-->
                    </select>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.state}}</span>

                </td>
            </tr>
            <tr>
                <td class="td-title">入库日期</td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="stockTime" data-type='1'>
                    <input class="text-left" id="addCreateDate" @focus="showDatePicker($event,'main','stockTime')"
                           v-if="showInput('入库日期')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.stockTime"/>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.stockTime}}</span>
                </td>
                <td class="td-title">库存地</td>
                <td class="td-value2" colspan="1">
                    <select v-if="showInput('库存地')" class=" td-row2 td-value" id="testStock" v-model="selectStock"
                            @change="changeState">
                        <option value=""></option>
                        <option v-for="option in stocks" :value="option.stockArea">{{option.stockArea}}</option>
                    </select>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{sampleParmsList.main.storeAddress}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">随机配件</td>
                <td class="td-value2 ">
                    <input class="text-left"
                           v-if="showInput('随机配件')" v-model="sampleParmsList.main.deviceParts"
                           style="width: 100%;border: 0px;" type="text"
                    />
                    <span v-else class="pull-left "
                          style="margin-left: 10px;">{{sampleParmsList.main.deviceParts}}</span>
                </td>
                <td class="td-title">铭牌照片</td>
                <td>
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle fj-one-tanzhongStyle"
                             v-if="sampleParmsList.main.namePlateAttachName">
                            <b :class="fjStyle(sampleParmsList.main.namePlateAttachName)"></b>
                            <div class="name" style="width: 165px;" :title="sampleParmsList.main.namePlateAttachName"
                                 v-on:click="download(sampleParmsList.main.namePlateAttachUrl,sampleParmsList.main.namePlateAttachName)">
                                {{sampleParmsList.main.namePlateAttachName}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(sampleParmsList.main.namePlateAttachUrl,sampleParmsList.main.namePlateAttachName)">下载</a>
                            </div>
                            <div class="del" v-if="pageType!='look'&&sampleParmsList.main.namePlateAttachName"><a
                                    href="javascript:void(0)" class="nui-txt-link"
                                    @click="deleteFile('namePlateAttach')">删除</a></div>
                        </div>
                        <span v-else-if="pageType=='look'" class="pull-left" style="margin-left: 10px">无</span>
                    </div>
                    <div style="height: 29px" v-if="showInput('铭牌照片')"
                         :class="pageType=='look'?'fujian  noFujian':'fujian Hfj'"
                         id="namePlateAttach">上传附件
                    </div>
                </td>
            </tr>
            <tr>
                <td class="td-title">随机附件</td>
                <td class="td-value2">
                    <select v-if="showInput('随机附件')" class=" td-row2 td-value"
                            v-model="sampleParmsList.main.deviceAnnex">
                        <option value=""></option>
                        <option value="管路">管路</option>
                        <option value="铲斗">铲斗</option>
                    </select>
                    <span v-else class="text-center "
                          style="margin-left: 10px">{{sampleParmsList.main.deviceAnnex}}</span>
                </td>
                <!--<td>
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle fj-one-tanzhongStyle"  v-if="sampleParmsList.main.partsAttachName">
                            <b :class="fjStyle(sampleParmsList.main.partsAttachName)"></b>
                            <div class="name" style="width: 165px;" :title="sampleParmsList.main.partsAttachName" v-on:click="download(sampleParmsList.main.partsAttachUrl,sampleParmsList.main.partsAttachName)">{{sampleParmsList.main.partsAttachName}}</div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link" v-on:click="download(sampleParmsList.main.partsAttachUrl,sampleParmsList.main.partsAttachName)">下载</a></div>
                            <div class="del"  v-if="pageType!='look'&&sampleParmsList.main.partsAttachName"><a href="javascript:void(0)" class="nui-txt-link" @click="deleteFile('partsAttach')">删除</a></div>
                        </div>
                        <span v-else-if="pageType=='look'" class="pull-left" style="margin-left: 10px">无</span>
                    </div>
                    <div  style="height: 29px" v-if="showInput('随机附件')" :class="pageType=='look'?'fujian  noFujian':'fujian Hfj'"
                          id="partsAttach">上传附件
                    </div>
                </td>-->
                <td class="td-title">描述</td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="description" data-type='1'>
                    <input class="text-left" placeholder="设备配置的管路、铲斗斗容等信息"
                           v-if="showInput('描述')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.description"/>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.description}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">实际交车日期</td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="actualDeliveryDate" data-type='1'>
                    <input class="text-left" @focus="showDatePicker($event,'main','actualDeliveryDate')"
                           v-if="showInput('实际交车日期')" v-model="sampleParmsList.main.actualDeliveryDate"
                           style="width: 100%;border: 0px" type="text"
                    />
                    <span v-else class="pull-left"
                          style="margin-left: 10px">{{sampleParmsList.main.actualDeliveryDate}}</span>
                </td>
                <td class="td-title">在库时长</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left" style="margin-left: 10px">{{storeDuration}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title" rowspan="2" style="line-height: 48px;">备注</td>
                <td rowspan="2" class="td-tanZongStyle td-value2 moreList" data-table="t_dvc_sample"
                    data-column="remark" data-type='1' colspan="3">
                    <textarea class="text-left"
                              v-if="showInput('备注')" style="box-shadow: inset 1px 1px 4px #333;
                              width: 100%;height: 100%; position: absolute;top: 0;left: 0;" type="text"
                              v-model="sampleParmsList.main.remark"></textarea>
                    <span v-else class="lineSpan" style="margin-left: 10px">{{sampleParmsList.main.remark}}</span>
                </td>
            </tr>
            <tr>
            </tr>
            <tr>
                <td class="td-value2" name="psc" style="display: none">钎杆直径</td>
                <td colspan="3" class="td-row2 width90 td-value1" name="psc" style="display: none">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.drillDiameter"/>
                    <span v-else class="pull-left"
                          style="margin-left: 10px">{{sampleParmsList.main.drillDiameter}}</span>
                </td>
                <td class="td-value2" name="sfj" style="display: none">最大处理量</td>
                <td colspan="3" class="td-row2 width90 td-value1" name="sfj" style="display: none">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.maxCapacity"/>
                    <span v-else class="pull-left"
                          style="margin-left: 10px">{{sampleParmsList.main.maxCapacity}}</span>
                </td>
            </tr>
        </table>

        <table id="pick" class="table-detail">
            <tr class="no-print">
                <td colspan="4" class=" no-print title">提货及应付信息</td>
            </tr>
            <tr>
                <td class="td-title" style="width: 25%"><i class="biTian">*</i>提货日期</td>
                <td class="td-value2" style="width: 25%">
                    <input class="text-left" @focus="showDatePicker($event,'main','pickUpDate')" v-if="showInput('0')"
                           v-model="sampleParmsList.main.pickUpDate" style="width: 100%;border: 0px" type="text"
                    />
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.pickUpDate}}</span>
                </td>
                <td class="td-title" style="width: 25%">提货价格(元)</td>
                <td class="td-value2 moreList" style="width: 25%" data-table="t_dvc_sample" data-column="pickupPrice"
                    data-type='1'>
                    <input v-if="showInput('提货价格')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'sampleParmsList.main.pickupPrice')"
                           @focus="strFormatF($event.target,'sampleParmsList.main.pickupPrice')"
                           v-onedate="fmoney(sampleParmsList.main.pickupPrice)"
                    />
                    <span v-else class="pull-left" style="margin-left: 10px">{{fmoney(sampleParmsList.main.pickupPrice)}}</span>
                    <!--<span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
            </tr>
        </table>
        <table class="table-detail " style="border-top-width:0px;" id="config">
            <tr>
                <td class="td-title" style="width: 25%">提货合同/协议/邮件</td>
                <td>
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in sampleParmsList.attaches">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <div class="del" v-if="showInput('提货合同')"><a href="javascript:void(0)" class="nui-txt-link"
                                                                         @click="deleteFiles('sample','attaches',i)">删除</a>
                            </div>
                            <!--<div class="info">11.35K <span class="nui-txt-suc">上传完成</span></div>-->
                        </div>
                        <span v-if="pageType=='look'&&sampleParmsList.attaches.length==0" class="pull-left"
                              style="margin-left: 10px">无</span>
                        <!--<div v-for="(attach,i) in sampleParmsList.attaches" class="progressobj">-->
                        <!--<input type="button" class="IcoNormal" style="float:left;cursor: pointer"-->
                        <!--v-on:click="download(attach.url,attach.name)"/>-->
                        <!--<div class=" " style="float:left;cursor: pointer;max-width:400px"-->
                        <!--v-on:click="download(attach.url,attach.name)">-->
                        <!--{{attach.name}}-->
                        <!--</div>-->
                        <!--<div class="delfile">-->
                        <!--<span v-if="pageType!='look'&&attach.name"><a href="javascript:void(0);"-->
                        <!--@click="deleteFiles('sample','attaches',i)"><span-->
                        <!--style="color: red;font-weight: bold;">X</span></a></span>-->
                        <!--</div>-->
                        <!--</div>-->
                    </div>
                </td>
                <td style="width: 25%">
                    <div class="Hfj" v-if="showInput('提货合同')" id="divUpload">
                        添加附件
                    </div>
                </td>
            </tr>
        </table>
        <table class="table-detail" id="parts">
            <!--<tr>
                <td colspan="4" class="no-print title" style="height: 30px">
                    <span v-if="pageType!='look'" style="margin-left:390px;color:black;">随机附件清单</span>
                    <span v-else style="margin-left:286px;color:black;">随机附件清单</span>
                    &lt;!&ndash; <span v-if="pageType!='look'" style="text-align: center;">随机附件清单</span>
                     <span  v-else style="text-align: center;">随机附件清单</span>&ndash;&gt;
                    <span class="span-a-btn" style="margin-left:280px">
                        <span v-if="pageType!='look'">
                            <a href="javascript:void(0);" style="color:black; margin-left:10px" class="pull-right" @click="delRow('part')">删除一行</a>
                    <a href="javascript:void(0);" style="color:black"  class="a-btn pull-right" @click="addRow('part')">添加一行</a>
               </span>
                </span>
                </td>
            </tr>
            <tr v-for="(item,i) in deviceParts">
                <td  class="td-title">随机附件({{getNumber(i+1)}})</td>
                <td  class="td-value2" colspan="3">
                    <input v-if="showInput('随机附件')" style="border: 0px" type="text"
                           v-model="item.partsName"/>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{item.partsName}}</span>
                </td>
                &lt;!&ndash;<td class="td-title" style="width: 211px">配件费用</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'deviceParts.'+i+'.partsPrice')"
                           @focus="strFormatF($event.target,'deviceParts.'+i+'.partsPrice')"
                           v-onedate="fmoney(item.partsPrice)"/>
                    <span class="pull-left" style="margin-left: 10px"
                          v-else>{{fmoney(item.partsPrice)}}</span>
                    <span style="position:absolute;left:105px;top: 0px;">元</span>
                </td>&ndash;&gt;
            </tr>-->
            <tr>
                <td class="td-title" style="width: 25%">发票附件</td>
                <td style="width: 25%">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle fj-one-tanzhongStyle"
                             v-if="sampleParmsList.main.invoiceAttachName">
                            <b :class="fjStyle(sampleParmsList.main.invoiceAttachName)"></b>
                            <div class="name" style="width: 165px;" :title="sampleParmsList.main.invoiceAttachName"
                                 v-on:click="download(sampleParmsList.main.invoiceAttachUrl,sampleParmsList.main.invoiceAttachName)">
                                {{sampleParmsList.main.invoiceAttachName}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(sampleParmsList.main.invoiceAttachUrl,sampleParmsList.main.invoiceAttachName)">下载</a>
                            </div>
                            <div class="del" v-if="pageType!='look'&&sampleParmsList.main.invoiceAttachName"><a
                                    href="javascript:void(0)" class="nui-txt-link" @click="deleteFile('invoiceAttach')">删除</a>
                            </div>
                        </div>
                        <span v-else-if="pageType=='look'" class="pull-left" style="margin-left: 10px">无</span>
                    </div>
                    <div v-if="showInput('发票附件')" :class="pageType=='look'?'fujian fj noFujian':'fujian fj Hfj'"
                         id="invoiceAttach">上传发票照片
                    </div>
                </td>
                <td class="td-title" style="width: 25%">合格证</td>
                <td class="td-row2 td-value1" style="width: 25%">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle fj-one-tanzhongStyle"
                             v-if="sampleParmsList.main.certificationAttachName">
                            <b :class="fjStyle(sampleParmsList.main.certificationAttachName)"></b>
                            <div class="name" style="width: 165px;"
                                 :title="sampleParmsList.main.certificationAttachName"
                                 v-on:click="download(sampleParmsList.main.certificationAttachUrl,sampleParmsList.main.certificationAttachName)">
                                {{sampleParmsList.main.certificationAttachName}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(sampleParmsList.main.certificationAttachUrl,sampleParmsList.main.certificationAttachName)">下载</a>
                            </div>
                            <div class="del" v-if="pageType!='look'&&sampleParmsList.main.certificationAttachName"><a
                                    href="javascript:void(0)" class="nui-txt-link"
                                    @click="deleteFile('certificationAttach')">删除</a></div>
                        </div>
                        <span v-else-if="pageType=='look'" class="pull-left" style="margin-left: 10px">无</span>
                    </div>
                    <div v-if="showInput('合格证')" :class="pageType=='look'?'fujian fj noFujian':'fujian fj Hfj'"
                         id="certificationAttach">上传附件
                    </div>
                </td>
            </tr>
            <tr>
                <td class="td-title">付款方式</td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="payment" data-type='1'>
                    <select v-if="showInput('付款方式')" class=" td-row2 td-value" id="testPayment" v-model="selectPayment"
                            class="form-control select2 exhibitionTypeSelect">
                        <option value=""></option>
                        <option v-for="option in payment" :value="option.value">{{option.value}}</option>
                    </select>
                    <span v-else class="pull-left" style="margin-left: 10px">{{sampleParmsList.main.payment}}</span>
                </td>
                <td class="td-title">免息期到期日</td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="freeMaturityDate" data-type='1'>
                    <input class="text-left" @focus="showDatePicker($event,'main','freeMaturityDate')"
                           v-model="sampleParmsList.main.freeMaturityDate"
                           v-if="showInput('免息期到期日')" style="border: 0px" type="text"
                    />
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{sampleParmsList.main.freeMaturityDate}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">客户是否融资</td>
                <td class="td-value2">
                    <select v-if="showInput('客户是否融资')" class=" td-row2 td-value" v-model="sampleParmsList.main.financing"
                            class="form-control select2 exhibitionTypeSelect">
                        <option value="是">是</option>
                        <option value="否">否</option>
                    </select>
                    <span v-else class="text-center "
                          style="margin-left: 10px">{{sampleParmsList.main.financing}}</span>
                </td>
                <template v-if="sampleParmsList.main.financing=='是'">
                    <td class="td-title">融资放款金额</td>
                    <td class="td-value2">
                        <input v-if="showInput('融资放款金额')" style="width: 100%;border: 0px" type="text"
                               @blur="strFormat($event.target,'sampleParmsList.main.financingAmount')"
                               @focus="strFormatF($event.target,'sampleParmsList.main.financingAmount')"
                               v-onedate="fmoney(sampleParmsList.main.financingAmount)"/>
                        <span v-else class="pull-left" style="margin-left: 10px">
                            {{fmoney(sampleParmsList.main.financingAmount)}}
                        </span>
                    </td>
                </template>
                <template v-else>
                    <td class="td-title"></td>
                    <td></td>
                </template>
                <!--<td class="td-title" style="width: 211px">付款情况</td>
                <td class="td-value2">
                    <select v-if="showInput('付款情况')" class=" td-row2 td-value" id="testStatus" v-model="selectStatus"
                            class="form-control select2 exhibitionTypeSelect">
                        <option value=""></option>
                        <option v-for="option in paymentSituation" :value="option.value">{{option.value}}</option>
                    </select>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{sampleParmsList.main.paymentStatus}}</span>

                </td>-->
            </tr>
            <tr>
                <td class="td-title">是否已结清</td>
                <td data-table="t_dvc_sample" data-column="settle" data-type='1' class="td-value2">
                    <select v-if="showInput('是否已结清')" class=" td-row2 td-value" v-model="sampleParmsList.main.settle"
                            class="form-control select2 exhibitionTypeSelect">
                        <option value="是">是</option>
                        <option value="否">否</option>
                    </select>
                    <span v-else class="text-center " style="margin-left: 10px">{{sampleParmsList.main.settle}}</span>
                </td>
                <td class="td-title"></td>
                <td></td>
                <!-- <td class="td-row2 width90 td-value1" colspan="1">
                     <span v-if="showInput('是否已结清')" style="margin-left: 10px" class="pull-left">
                     <input type="radio" checked="checked" v-model="sampleParmsList.main.settle" value="是" name="settle">是&nbsp;&nbsp;&nbsp;&nbsp;
                     <input type="radio" value="否" v-model="sampleParmsList.main.settle" name="settle">否&nbsp;&nbsp;&nbsp;&nbsp;
                 </span>
                     <span v-else style="margin-left: 10px" class="pull-left">
                     <input type="radio" value="是" disabled="disabled" v-model="sampleParmsList.main.settle"
                            name="settle">是&nbsp;&nbsp;&nbsp;&nbsp;
                     <input type="radio" value="否" disabled="disabled" v-model="sampleParmsList.main.settle"
                            name="settle">否&nbsp;&nbsp;&nbsp;&nbsp;
                 </span>
                 </td>-->
            </tr>
            <tr>
                <td rowspan="2" style="line-height: 48px;" class="td-title">备注</td>
                <td rowspan="2" class="td-value2 moreList" colspan="3" data-table="t_dvc_sample"
                    data-column="accessoriesRemark" data-type='1'>
                        <textarea class="text-left" style="box-shadow: inset 1px 1px 4px #333;
                              width: 100%;height: 100%; position: absolute;top: 0;left: 0;"
                                  v-if="showInput('附件备注')" style="border: 0px" type="text"
                                  v-model="sampleParmsList.main.accessoriesRemark"></textarea>
                    <span v-else class="lineSpan"
                          style="margin-left: 10px">{{sampleParmsList.main.accessoriesRemark}}</span>
                </td>

            </tr>
        </table>
        <table id="repayment" class="table-detail">
            <tr>
                <td colspan="9" class="no-print title">
                    <span v-if="pageType!='look'" style="margin-left:390px;color:black;">到期还款计划</span>
                    <span v-else style="margin-left:286px;color:black;">到期还款计划</span>
                    <span class="span-a-btn" style="margin-left:280px">
                        <span v-if="pageType!='look'">
                            <a href="javascript:void(0);" style="color: black; margin-left: 10px" class="pull-right"
                               @click="delRow()">删除一行</a>
                    <a href="javascript:void(0);" style="color: black" class="a-btn pull-right"
                       @click="addRow()">添加一行</a>

               </span>
                </span>
                </td>
            </tr>
            <tr>
                <td style="width: 90px" class="td-title">预计付款日期</td>
                <td style="width: 90px" class="td-title">预计付款金额(元)</td>
                <!-- <td style="width: 90px" class="td-title">款项类型</td>-->
                <td style="width: 110px" class="td-title">收款方</td>
                <td style="width: 180px" class="td-title">开户银行</td>
                <td style="width: 140px" class="td-title">账号</td>
                <td style="width: 90px" class="td-title">付款日期</td>
                <td style="width: 90px" class="td-title">付款金额(元)</td>
                <td style="width: 120px" class="td-title">还款凭证</td>
                <td style="width: 120px" class="td-title">备注</td>
            </tr>

            <tr v-for="(item,i) in RepaymentPlanList">

                <td class="td-value2 moreList" data-table="t_dvc_repayment_plan" data-column="sample_id"
                    :data-mid="sampleParmsList.main.id" data-columnName="EXPIRATION_DATE" data-type='2'>
                    <input class="text-left" @focus="showDatePicker($event,0,'expirationDate',i)"
                           v-model="item.expirationDate" v-if="showInput('到期还款计划')" style="width: 100%;border: 0px"
                           type="text"/>
                    <span v-else style="display: block;text-align: center">{{item.expirationDate}}</span>
                </td>

                <td class="td-value2 moreList" data-table="t_dvc_repayment_plan" data-column="sample_id"
                    :data-mid="sampleParmsList.main.id" data-columnName="EXPIRATION_MONEY" data-type='2'>
                    <input v-if="showInput('到期还款计划')" class="text-center" style="width: 100%;" type="text"
                           @blur="strFormat($event.target,'RepaymentPlanList.'+i+'.expirationMoney')"
                           @focus="strFormatF($event.target,'RepaymentPlanList.'+i+'.expirationMoney')"
                           v-onedate="fmoney(item.expirationMoney)"/>
                    <span v-else style="display: block;text-align: center">{{fmoney(item.expirationMoney)}}</span>
                </td>

                <!-- <td class="td-row2 width90 td-value1">
                     <select v-if="showInput('到期还款计划')" class=" td-row2 td-value" id="testMoneyType"
                             v-model="item.paymentType">
                         <option value="提车款">提车款</option>
                         <option value="到期款">到期款</option>
                         <option value="定金">定金</option>
                         <option value="其他">其他</option>
                     </select>
                     <span v-else class="text-center " style="margin-left: 10px">{{item.paymentType}}</span>
                 </td>-->
                <td class="td-value2 moreList" data-table="t_dvc_repayment_plan" data-column="sample_id"
                    :data-mid="sampleParmsList.main.id" data-columnName="PAYEE" data-type='2'>
                    <div style="height: 100%;line-height: 20px;" v-if="showInput('到期还款计划')">
                        <select class=" td-row2 td-value" v-model="item.payee"
                                @change="getAccount(item.payee,i)">
                            <option value=""></option>
                            <option v-for="option in payees" v-bind:value="option.bankName">{{option.bankName}}</option>
                        </select>
                    </div>
                    <span v-else style="display: block;text-align: center" class="text-center lineSpan"
                          style="margin-left: 10px">{{item.payee}}</span>
                </td>
                <!-- <td class="td-row2 width90 td-value1 ">
                     <span class="text-center  lineSpan"
                           style="text-align:center;height:24px;width: 100%;border-bottom: 1px solid #ddd;" type="text">{{item.accountName}}</span>
                     <span class="text-center  lineSpan" style="text-align:center;height:24px;width: 100%;" type="text">{{item.payeeAccount}}</span>
                 </td>-->
                <td class="td-value2 moreList" data-table="t_dvc_repayment_plan" data-column="sample_id"
                    :data-mid="sampleParmsList.main.id" data-columnName="ACCOUNT_NAME" data-type='2'>
                    <span class="text-center  lineSpan" style="text-align:center;height:24px;width: 100%;" type="text">{{item.accountName}}</span>
                </td>
                <td class="td-value2 moreList" data-table="t_dvc_repayment_plan" data-column="sample_id"
                    :data-mid="sampleParmsList.main.id" data-columnName="PAYEE_ACCOUNT" data-type='2'>
                    <span class="text-center  lineSpan" style="text-align:center;height:24px;width: 100%;" type="text">{{item.payeeAccount}}</span>
                </td>
                <td class="td-value2 moreList" data-table="t_dvc_repayment_plan" data-column="sample_id"
                    :data-mid="sampleParmsList.main.id" data-columnName="PAYMENT_DATE" data-type='2'>
                    <input v-if="showInput('到期还款计划')" class="text-left"
                           @focus="showDatePicker($event,0,'paymentDate',i)"
                           v-model="item.paymentDate" style="width: 100%;border: 0px" type="text"
                    />
                    <span v-else style="display: block;text-align: center" style="margin-left: 10px">{{item.paymentDate}}</span>
                </td>
                <td class="td-value2 moreList" data-table="t_dvc_repayment_plan" data-column="sample_id"
                    :data-mid="sampleParmsList.main.id" data-columnName="PAYMENT_MONEY" data-type='2'>
                    <input v-if="showInput('到期还款计划')" class="text-center" style="width: 100%;" type="text"
                           @blur="strFormat($event.target,'RepaymentPlanList.'+i+'.paymentMoney')"
                           @focus="strFormatF($event.target,'RepaymentPlanList.'+i+'.paymentMoney')"
                           v-onedate="fmoney(item.paymentMoney)"/>
                    <span v-else style="display: block;text-align: center">{{fmoney(item.paymentMoney)}}</span>
                </td>
                <td class="td-row2 width90 td-value1">
                    <div class="fj-tanzhongStyle fj-one-tanzhongStyle" v-if="item.repaymentCertificateAttachName">
                        <b :class="fjStyle(item.repaymentCertificateAttachName)"></b>
                        <div class="name" :title="item.repaymentCertificateAttachName"
                             v-on:click="download(item.repaymentCertificateAttachUrl,item.repaymentCertificateAttachName)">
                            {{item.repaymentCertificateAttachName}}
                        </div>
                        <div class="del" v-if="pageType!='look'&&item.repaymentCertificateAttachName"><a
                                href="javascript:void(0)" class="nui-txt-link"
                                v-on:click="deleteFileRP('repaymentCertificateAttach',i)">删除</a></div>
                    </div>
                    <div v-if="showInput('到期还款计划')"
                         :class="pageType=='look'?'fujian fj noFujian':'fujian fj Hfj'"
                         :id="'repaymentCertificateAttach'+i">上传附件
                    </div>
                </td>
                <td class="td-value2 moreList" data-table="t_dvc_repayment_plan" data-column="sample_id"
                    :data-mid="sampleParmsList.main.id" data-columnName="REMARK" data-type='2'>
                    <input class="text-left" @click="remarks(item)"
                           v-model="item.remark" v-if="showInput('到期还款计划')" style="width: 100%;border: 0px"
                           type="text"
                    />
                    <span v-else style="display: block;text-align: center">{{item.remark}}</span>
                </td>
            </tr>
        </table>
        <table id="transport" class="table-detail">
            <tr class="no-print">
                <td colspan="6" class=" no-print title">入库物流信息
                    <a href="javascript:void(0)"
                       v-if="showInput('更改入库物流信息')" style="height: 22px;position: absolute;right: 0px;color:black;"
                       @click="changelogistics(sampleParmsList.main.id)">更改入库物流信息
                    </a>
                </td>
            </tr>
            <tr>
                <td style="width: 15.8%;" class="td-title">出发地</td>
                <td class="td-value2" style="width: 17.5%px">
                    <select v-if="showInput('0')" class=" td-row2 td-value"
                            v-model="sampleParmsList.main.trafficStarting"
                            @change="getFactoryContactAndTel()">
                        <option value=""></option>
                        <option v-for="option in factorys" :value="option.brandAddress">{{option.brandAddress}}</option>
                    </select>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{sampleParmsList.main.trafficStarting}}</span>
                </td>
                <td style="width: 15.8%;" class="td-title">厂家联系人</td>
                <td class="td-value2" style="width: 17.5%">
                    <select v-if="showInput('0')" class=" td-row2 td-value"
                            v-model="sampleParmsList.main.factoryContacts"
                            @change="getFactoryTel">
                        <option value=""></option>
                        <option v-for="option in factoryContacts" :value="option.contact">{{option.contact}}</option>
                    </select>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{sampleParmsList.main.factoryContacts}}</span>
                </td>
                <td style="width: 15.8%;" class="td-title">电话</td>
                <td class="td-value2" style="width: 17.5%">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.factoryTel"/>
                    <span v-else class="text-left  lineSpan" style="margin-left: 10px" type="text">{{sampleParmsList.main.factoryTel}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">目的地</td>
                <td class="td-value2" style="width: 233px">
                    <select v-if="showInput('0')" class=" td-row2 td-value"
                            v-model="sampleParmsList.main.trafficDestination"
                            @change="getDestinContactAndTel()">
                        <option value=""></option>
                        <option v-for="option in stocks" :value="option.stockArea">{{option.stockArea}}</option>
                    </select>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{sampleParmsList.main.trafficDestination}}</span>
                </td>
                <td style="width: 211px;" class="td-title">接车联系人</td>
                <td class="td-value2" style="width: 233px">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.shuttleContacts"/>
                    <span v-else class="text-left  lineSpan" style="margin-left: 10px" type="text">{{sampleParmsList.main.shuttleContacts}}</span>
                </td>
                <td style="width: 211px;" class="td-title">电话</td>
                <td class="td-value2" style="width: 233px">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.shuttleTel"/>
                    <span v-else class="text-left  lineSpan" style="margin-left: 10px" type="text">{{sampleParmsList.main.shuttleTel}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">运输公司</td>
                <td class="td-value2" style="width: 233px">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.transportCompany" id="traCompany" showList="true"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{sampleParmsList.main.transportCompany}}</span>
                </td>
                <td class="td-title">运输公司联系人</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.contacts"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{sampleParmsList.main.contacts}}</span>
                </td>
                <td class="td-title">电话</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.telephone"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{sampleParmsList.main.telephone}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">运费（含专票)/元</td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="specialFee" data-type='1'>
                    <input v-if="showInput('运费含专票')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'sampleParmsList.main.specialFee')"
                           @focus="strFormatF($event.target,'sampleParmsList.main.specialFee')"
                           v-onedate="fmoney(sampleParmsList.main.specialFee)"
                    />
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{fmoney(sampleParmsList.main.specialFee)}}</span>
                    <!--<span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款(元)</td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="deductionFee" data-type='1'>
                    <input v-if="showInput('扣款')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'sampleParmsList.main.deductionFee')"
                           @focus="strFormatF($event.target,'sampleParmsList.main.deductionFee')"
                           v-onedate="fmoney(sampleParmsList.main.deductionFee)"
                    />
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{fmoney(sampleParmsList.main.deductionFee)}}</span>
                    <!-- <span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款说明</td>
                <td class="td-value2 moreList" data-table="t_dvc_sample" data-column="deductionRemark" data-type='1'>
                    <input v-if="showInput('扣款说明')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.deductionRemark"/>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{sampleParmsList.main.deductionRemark}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">板车车牌</td>
                <td class="td-value2">
                    <input v-if="showInput('板车车牌')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.drayLicense"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{sampleParmsList.main.drayLicense}}</span>
                </td>
                <td style="width: 211px;" class="td-title">运输开始日期</td>
                <td class="td-value2" style="width: 233px">
                    <input v-if="showInput('运输开始日期')" class="text-left"
                           @focus="showDatePicker($event,'main','transportStartTime')"
                           style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.transportStartTime"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{sampleParmsList.main.transportStartTime}}</span>
                </td>
                <td class="td-title">运输结束日期</td>
                <td class="td-value2">
                    <input class="text-left" @focus="showDatePicker($event,'main','transportEndTime')"
                           v-model="sampleParmsList.main.transportEndTime"
                           v-if="showInput('入库运输结束日期')" style="width: 100%;border: 0px" type="text"
                    />
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{sampleParmsList.main.transportEndTime}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">司机姓名</td>
                <td class="td-value2">
                    <input v-if="showInput('司机姓名')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.driverName"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{sampleParmsList.main.driverName}}</span>
                </td>
                <td class="td-title">司机电话</td>
                <td class="td-value2">
                    <input v-if="showInput('司机电话')" style="width: 100%;border: 0px" type="text"
                           v-model="sampleParmsList.main.driverTel"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{sampleParmsList.main.driverTel}}</span>
                </td>
                <td class="td-title">司机证件</td>
                <td>
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle fj-one-tanzhongStyle" v-if="sampleParmsList.main.driverAttachName">
                            <b :class="fjStyle(sampleParmsList.main.driverAttachName)"></b>
                            <div class="name" style="width: 165px;" :title="sampleParmsList.main.driverAttachName"
                                 v-on:click="download(sampleParmsList.main.driverAttachUrl,sampleParmsList.main.driverAttachName)">
                                {{sampleParmsList.main.driverAttachName}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(sampleParmsList.main.driverAttachUrl,sampleParmsList.main.driverAttachName)">下载</a>
                            </div>
                            <div class="del" v-if="pageType!='look'&&sampleParmsList.main.driverAttachName"><a
                                    href="javascript:void(0)" class="nui-txt-link" @click="deleteFile('driverAttach')">删除</a>
                            </div>
                        </div>
                        <span v-else-if="pageType=='look'" class="pull-left" style="margin-left: 10px">无</span>
                    </div>
                    <div v-if="showInput('司机证件')" :class="pageType=='look'?'fujian fj noFujian':'fujian fj Hfj'"
                         id="driverAttach">上传附件
                    </div>
                </td>
            </tr>
            <!--<tr>
                <td class="td-title">板车照片</td>
                <td class="td-row2 td-value1" colspan="2">
                    <div id="divUploadedFiles">
                        <div v-for="(attach,i) in sampleParmsList.drayPictures" class="progressobj">
                            <input type="button" class="IcoNormal" style="float:left;cursor: pointer"
                                   v-on:click="download(attach.url,attach.name)"/>
                            <div class="filename lineOne" style="float:left;cursor: pointer"
                                 v-on:click="download(attach.url,attach.name)">
                                {{attach.name}}
                            </div>
                            <div class="delfile">
                                <span v-if="pageType!='look'&&attach.name"><a href="javascript:void(0);"
                                                                              @click="deleteFiles('sample','drayPictures',i)"><span
                                        style="color: red;font-weight: bold;">X</span></a></span>
                            </div>
                        </div>
                    </div>
                </td>
                <td colspan="4">
                    <div v-if="showInput('0')" id="drayPictures" class="rightBorder fj fujian">
                        上传照片
                    </div>
                </td>
            </tr>-->
            <!-- <tr>
                 <td class="td-title">司机证件</td>
                 <td class="td-row2 td-value1" colspan="2">
                     <div id="divUploadedFiles">
                         <div v-for="(attach,i) in sampleParmsList.certificates" class="progressobj">
                             <input type="button" class="IcoNormal" style="float:left;cursor: pointer"
                                    v-on:click="download(attach.url,attach.name)"/>
                             <div class="filename lineOne" style="float:left;cursor: pointer"
                                  v-on:click="download(attach.url,attach.name)">
                                 {{attach.name}}
                             </div>
                             <div class="delfile">
                                 <span v-if="pageType!='look'&&attach.name"><a href="javascript:void(0);"
                                                                               @click="deleteFiles('sample','certificates',i)"><span
                                         style="color: red;font-weight: bold;">X</span></a></span>
                             </div>
                         </div>
                     </div>
                 </td>
                 <td colspan="4">
                     <div v-if="showInput('0')" id="certificates" class="rightBorder fj fujian">
                         上传证件
                     </div>
                 </td>
             </tr>-->
            <tr>
                <td class="td-title">板车及设备照片</td>
                <td class="td-row2 td-value1" colspan="4">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in sampleParmsList.devicePictures">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <div class="del" v-if="pageType!='look'&&attach.name"><a href="javascript:void(0)"
                                                                                     class="nui-txt-link"
                                                                                     @click="deleteFiles('sample','devicePictures',i)">删除</a>
                            </div>
                        </div>
                        <!--<div v-for="(attach,i) in sampleParmsList.devicePictures" class="progressobj">
                            <input type="button" class="IcoNormal" style="float:left;cursor: pointer"
                                   v-on:click="download(attach.url,attach.name)"/>
                            <div class="filename lineOne" style="float:left;cursor: pointer"
                                 v-on:click="download(attach.url,attach.name)">
                                {{attach.name}}
                            </div>
                            <div class="delfile">
                                <span v-if="pageType!='look'&&attach.name"><a href="javascript:void(0);"
                                                                              @click="deleteFiles('sample','devicePictures',i)"><span
                                        style="color: red;font-weight: bold;">X</span></a></span>
                            </div>
                        </div>-->
                    </div>
                </td>
                <td>
                    <div v-if="showInput('板车及设备照片')" id="devicePictures" class="rightBorder fj fujian Hfj">
                        上传照片
                    </div>
                </td>
            </tr>
        </table>
        <table id="logistics" class="table-detail" style="display: none">
            <tr class="no-print">
                <td colspan="6" class=" no-print title">入库物流信息变更</td>
            </tr>
            <span style="display: none" id="logisticTime" class="td-title">物流变更  {{formatDate(logisticParmsList.main.createTime)}}</span>
            <tbody>
            <tr>
                <td style="" class="td-title">变更原因</td>
                <td class="td-row2 width90 td-value1" style="width: 233px">
                    <span class="pull-left lineSpan" style="margin-left: 10px">{{logisticParmsList.main.reason}}</span>
                </td>
                <td style="width: 211px;" class="td-title">出发地</td>
                <td class="td-row2 width90 td-value1" style="width: 233px">
                    <span class="pull-left " style="margin-left: 10px">{{logisticParmsList.main.trafficStarting}}</span>
                </td>

                <td style="width: 211px;" class="td-title">目的地</td>
                <td class="td-row2 width90 td-value1" style="width: 233px;">
                    <span class="pull-left "
                          style="margin-left: 10px">{{logisticParmsList.main.trafficDestination}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">运输公司</td>
                <td class="td-row2 width90 td-value1" style="width: 233px">
                    <span class="pull-left "
                          style="margin-left: 10px">{{logisticParmsList.main.transportCompany}}</span>
                </td>
                <td class="td-title">运输公司联系人</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left " style="margin-left: 10px">{{logisticParmsList.main.contacts}}</span>
                </td>
                <td class="td-title">电话</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left " style="margin-left: 10px">{{logisticParmsList.main.telephone}}</span>
                </td>
            </tr>

            <tr>
                <td class="td-title">板车车牌</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left " style="margin-left: 10px">{{logisticParmsList.main.drayLicense}}</span>
                </td>
                <td class="td-title">司机姓名</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left " style="margin-left: 10px">{{logisticParmsList.main.driverName}}</span>
                </td>
                <td class="td-title">司机电话</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left " style="margin-left: 10px">{{logisticParmsList.main.driverTel}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">运费（含专票)/元</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left "
                          style="margin-left: 10px">{{fmoney(logisticParmsList.main.specialFee)}}</span>
                    <!--<span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款(元)</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left "
                          style="margin-left: 10px">{{fmoney(logisticParmsList.main.deductionFee)}}</span>
                    <!--<span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款说明</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left lineSpan" style="margin-left: 10px">{{logisticParmsList.main.deductionRemark}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">运输开始日期</td>
                <td class="td-row2 width90 td-value1" style="width: 233px">
                    <span class="pull-left "
                          style="margin-left: 10px">{{logisticParmsList.main.transportStartTime}}</span>
                </td>
                <td class="td-title">运输结束日期</td>
                <td class="td-row2 width90 td-value1">
                    <span class="pull-left "
                          style="margin-left: 10px">{{logisticParmsList.main.transportEndTime}}</span>
                </td>
                <td class="td-title">司机证件</td>
                <td class="td-row2 td-value1">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in logisticParmsList.certificates">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <!--<div class="del" v-if="pageType!='look'&&attach.name"><a href="javascript:void(0)" class="nui-txt-link" @click="deleteFiles('sample','devicePictures',i)">删除</a></div>-->
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <!--<td class="td-title">板车照片</td>
                <td class="td-row2 td-value1">
                    <div id="divUploadedFiles">
                        <div v-for="(attach,i) in logisticParmsList.drayPictures" class="progressobj">
                            <input type="button" class="IcoNormal" style="float:left;cursor: pointer"
                                   v-on:click="download(attach.url,attach.name)"/>
                            <div class="filename lineOne" style="float:left;cursor: pointer"
                                 v-on:click="download(attach.url,attach.name)">
                                {{attach.name}}
                            </div>
                        </div>
                    </div>
                </td>-->
                <td class="td-title">板车及设备照片</td>
                <td class="td-row2 td-value1" colspan="5">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in logisticParmsList.devicePictures">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <!--<div class="del" v-if="pageType!='look'&&attach.name"><a href="javascript:void(0)" class="nui-txt-link" @click="deleteFiles('sample','devicePictures',i)">删除</a></div>-->
                        </div>
                        <!--<div v-for="(attach,i) in logisticParmsList.devicePictures" class="progressobj">
                            <input type="button" class="IcoNormal" style="float:left;cursor: pointer"
                                   v-on:click="download(attach.url,attach.name)"/>
                            <div class="filename lineOne" style="float:left;cursor: pointer"
                                 v-on:click="download(attach.url,attach.name)">
                                {{attach.name}}
                            </div>
                        </div>-->
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
        <table id="outbound" class="table-detail">
            <tr class="no-print">
                <td colspan="6" class=" no-print title">出库记录</td>
            </tr>
            <span class="td-title" style="display: none" id="outboundTime">出库时间  {{formatDate(outboundParmsList.main.createTime)}}</span>
            <tbody>
            <tr>
                <td style="width:15.8%" class="td-title">出库类型</td>
                <td class="td-row2 width90 td-value1" style="width:84.2%" colspan="5">
                    <span class="pull-left " style="margin-left: 10px">销售出库</span>
                </td>
            </tr>
            <tr>
                <td style="" class="td-title">销售合同</td>
                <td class="td-row2 width90 td-value1" style="width: 233px" colspan="5">
                    <span class="pull-left " style="margin-left: 10px;cursor: pointer" @click="goDetail('查看',i)">{{contract.contractNo}}</span>
                </td>
            </tr>
            <tr>
                <td style="width:15.8%" class="td-title">区域经理</td>
                <td class="td-value2" style="width:17.5%">
                    <span class="pull-left lineSpan"
                          style="margin-left: 10px">{{contract.regionManagerName}}</span>
                </td>
                <td style="width:15.8%;" class="td-title">交付客户</td>
                <td class="td-value2" style="width: 17.5%">
                    <span class="pull-left lineSpan"
                          style="margin-left: 10px">{{contract.buyer}}</span>
                </td>

                <td style="width:15.8%" class="td-title">电话</td>
                <td class="td-value2" style="width: 17.5%;">
                    <span class="pull-left "
                          style="margin-left: 10px">{{contract.buyerTel}}</span>
                </td>
            </tr>
            <tr>
                <td style="width:15.8%" class="td-title">提车地址</td>
                <td class="td-value2" style="width:17.5%">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.pickUpAddress"/>
                    <span v-else class="pull-left lineSpan"
                          style="margin-left: 10px">{{outboundParmsList.main.pickUpAddress}}</span>
                </td>
                <td style="width:15.8%;" class="td-title">联系人</td>
                <td class="td-value2" style="width: 17.5%">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.pickUpContacts"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{outboundParmsList.main.pickUpContacts}}</span>
                </td>

                <td style="width:15.8%" class="td-title">电话</td>
                <td class="td-value2" style="width: 17.5%;">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.pickUpTelephone"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{outboundParmsList.main.pickUpTelephone}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">交车地址</td>
                <td class="td-value2" style="width: 233px">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.delivery_address"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{outboundParmsList.main.delivery_address}}</span>
                </td>
                <td class="td-title">联系人</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.deliveryContacts"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{outboundParmsList.main.deliveryContacts}}</span>
                </td>
                <td class="td-title">电话</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.deliveryTelephone"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{outboundParmsList.main.deliveryTelephone}}</span>
                </td>
            </tr>

            <tr>
                <td class="td-title">运输公司</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           id="outTraCompany" showList="true" v-model="outboundParmsList.main.transport_company"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{outboundParmsList.main.transport_company}}</span>
                </td>
                <td class="td-title">联系人</td>
                <td class="td-value2">
                    <input v-if="showInput('出库运输公司联系人')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.contacts"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{outboundParmsList.main.contacts}}</span>
                </td>
                <td class="td-title">电话</td>
                <td class="td-value2">
                    <input v-if="showInput('出库运输公司电话')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.telephone"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{outboundParmsList.main.telephone}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">板车车牌</td>
                <td class="td-value2">
                    <input v-if="showInput('出库板车车牌')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.dray_license"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{outboundParmsList.main.dray_license}}</span>
                </td>
                <td class="td-title">司机姓名</td>
                <td class="td-value2">
                    <input v-if="showInput('出库司机姓名')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.driver_name"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{outboundParmsList.main.driver_name}}</span>
                </td>
                <td class="td-title">司机电话</td>
                <td class="td-value2">
                    <input v-if="showInput('出库司机电话')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.driver_tel"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{outboundParmsList.main.driver_tel}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">运费（含专票)/元</td>
                <td class="td-value2">
                    <input v-if="showInput('出库运费含专票')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'outboundParmsList.main.special_fee')"
                           @focus="strFormatF($event.target,'outboundParmsList.main.special_fee')"
                           v-onedate="fmoney(outboundParmsList.main.special_fee)"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{fmoney(outboundParmsList.main.special_fee)}}</span>
                    <!--<span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款(元)</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'outboundParmsList.main.deduction_fee')"
                           @focus="strFormatF($event.target,'outboundParmsList.main.deduction_fee')"
                           v-onedate="fmoney(outboundParmsList.main.deduction_fee)"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{fmoney(outboundParmsList.main.deduction_fee)}}</span>
                    <!--<span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款说明</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.deduction_remark"/>
                    <span v-else class="pull-left lineOne" style="margin-left: 10px">{{outboundParmsList.main.deduction_remark}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">运输开始日期</td>
                <td class="td-value2" style="width: 233px">

                    <input class="text-left" @focus="showDatePicker($event,'out','transportStartTime')"
                           v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.transportStartTime"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{outboundParmsList.main.transportStartTime}}</span>
                </td>
                <td class="td-title">运输结束日期</td>
                <td class="td-value2">
                    <input class="text-left" @focus="showDatePicker($event,'out','transportEndTime')"
                           v-if="showInput('出库运输结束日期')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.transportEndTime"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{outboundParmsList.main.transportEndTime}}</span>
                </td>
                <td class="td-title">司机证件</td>
                <td class="td-row2 td-value1" colspan="1">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in outboundParmsList.certificates">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link"
                                                                      @click="deleteFiles('out','certificates',i)">删除</a>
                            </div>
                        </div>
                    </div>
                </td>
                <!--<td colspan="1">
                    <div v-if="showInput('0')" id="outcertificates" class="rightBorder fj fujian">
                        上传证件
                    </div>
                </td>-->
            </tr>
            <tr>
                <td class="td-title">板车及设备照片</td>
                <td class="td-row2 td-value1" colspan="4">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in outboundParmsList.devicePictures">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link"
                                                                      @click="deleteFiles('out','devicePictures',i)">删除</a>
                            </div>
                        </div>
                        <!-- <div v-for="(attach,i) in outboundParmsList.devicePictures" class="progressobj">
                             <input type="button" class="IcoNormal" style="float:left;cursor: pointer"
                                    v-on:click="download(attach.url,attach.name)"/>
                             <div class="filename lineOne" style="float:left;cursor: pointer"
                                  v-on:click="download(attach.url,attach.name)">
                                 {{attach.name}}
                             </div>
                             <div class="delfile">
                                 <span v-if="pageType!='look'&&attach.name"><a href="javascript:void(0);"
                                                                               @click="deleteFiles('out','devicePictures',i)"><span
                                         style="color: red;font-weight: bold;">X</span></a></span>
                             </div>
                         </div>-->
                    </div>
                </td>
                <td>
                    <div v-if="showInput('0')" id="outdevicePictures" class="rightBorder fj fujian">
                        上传照片
                    </div>
                </td>
            </tr>
            <tr>
                <td rowspan="2" class="td-title" style="line-height: 48px">备注</td>
                <td rowspan="2" class="td-value2" colspan="5">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="outboundParmsList.main.remark"/>
                    <span v-else class="pull-left lineOne"
                          style="margin-left: 10px;max-height: 48px">{{outboundParmsList.main.remark}}</span>
                </td>
            </tr>
            <tr></tr>
            </tbody>
            <span style="color:white">X</span>
        </table>
        <table id="exit" class="table-detail">
            <tr class="no-print">
                <td colspan="6" class=" no-print title">退货记录</td>
            </tr>
            <span style="display: none" class="td-title" style="display: none" id="exitTime">退货时间  {{formatDate(exitParmsList.main.createTime)}}</span>
            <tbody>
            <tr>
                <td class="td-title" style="width:15.8%">出库类型</td>
                <td class="td-row2 width90 td-value1" style="width:84.2%" colspan="5">
                    <span style="margin-left: 10px" class="pull-left ">退货</span>
                </td>
            </tr>
            <tr>
                <td style="width:15.8%" class="td-title">原库存地</td>
                <td class="td-value2" style="width: 17.5%">
                    <select v-if="showInput('0')" class=" td-row2 td-value"
                            v-model="exitParmsList.main.pickUpAddress" @change="getOldContactAndTel()">
                        <option value=""></option>
                        <option v-for="option in stocks" :value="option.stockArea">{{option.stockArea}}</option>
                    </select>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{exitParmsList.main.pickUpAddress}}</span>
                </td>
                <td style="width: 15.8%;" class="td-title">联系人</td>
                <td class="td-value2" style="width: 17.5%">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.pickUpContacts"/>
                    <span v-else class="text-left  lineSpan" style="margin-left: 10px" type="text">{{exitParmsList.main.pickUpContacts}}</span>
                </td>

                <td style="width: 15.8%;" class="td-title">电话</td>
                <td class="td-value2" style="width: 17.5%;">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.pickUpTelephone"/>
                    <span v-else class="text-left  lineSpan" style="margin-left: 10px" type="text">{{exitParmsList.main.pickUpTelephone}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">新库存地</td>
                <td class="td-value2" style="width: 233px">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.delivery_address"/>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{exitParmsList.main.delivery_address}}</span>
                </td>
                <td class="td-title">联系人</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.deliveryContacts"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{exitParmsList.main.deliveryContacts}}</span>
                </td>
                <td class="td-title">电话</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.deliveryTelephone"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{exitParmsList.main.deliveryTelephone}}</span>
                </td>
            </tr>

            <tr>
                <td class="td-title">运输公司</td>
                <td class="td-value2">
                    <input v-if="showInput('退货运输公司')" style="width: 100%;border: 0px" type="text"
                           id="exitTraCompany" showList="true" v-model="exitParmsList.main.transport_company"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{exitParmsList.main.transport_company}}</span>
                </td>
                <td class="td-title">联系人</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.contacts"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{exitParmsList.main.contacts}}</span>
                </td>
                <td class="td-title">电话</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.telephone"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{exitParmsList.main.telephone}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">板车车牌</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.dray_license"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{exitParmsList.main.dray_license}}</span>
                </td>
                <td class="td-title">司机姓名</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.driver_name"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{exitParmsList.main.driver_name}}</span>
                </td>
                <td class="td-title">司机电话</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.driver_tel"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{exitParmsList.main.driver_tel}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">运费（含专票)/元</td>
                <td class="td-value2">
                    <input v-if="showInput('退货运费含专票')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'exitParmsList.main.special_fee')"
                           @focus="strFormatF($event.target,'exitParmsList.main.special_fee')"
                           v-onedate="fmoney(exitParmsList.main.special_fee)"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{fmoney(exitParmsList.main.special_fee)}}</span>
                    <!--<span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款(元)</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'exitParmsList.main.deduction_fee')"
                           @focus="strFormatF($event.target,'exitParmsList.main.deduction_fee')"
                           v-onedate="fmoney(exitParmsList.main.deduction_fee)"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{fmoney(exitParmsList.main.deduction_fee)}}</span>
                    <!--<span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款说明</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.deduction_remark"/>
                    <span v-else class="pull-left lineOne" style="margin-left: 10px">{{exitParmsList.main.deduction_remark}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">运输开始日期</td>
                <td class="td-value2" style="width: 233px">

                    <input class="text-left" @focus="showDatePicker($event,'exit','transportStartTime')"
                           v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.transportStartTime"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{exitParmsList.main.transportStartTime}}</span>
                </td>
                <td class="td-title">运输结束日期</td>
                <td class="td-value2">

                    <input class="text-left" @focus="showDatePicker($event,'exit','transportEndTime')"
                           v-if="showInput('退货运输结束日期')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.transportEndTime"/>
                    <span v-else="pageType=='look'" class="pull-left " style="margin-left: 10px">{{exitParmsList.main.transportEndTime}}</span>
                </td>
                <td class="td-title">司机证件</td>
                <td class="td-row2 td-value1">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in exitParmsList.certificates">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link"
                                                                      @click="deleteFiles('exit','certificates',i)">删除</a>
                            </div>
                        </div>
                    </div>
                    <div v-if="showInput('0')" id="exitcertificates" class="rightBorder fj fujian">
                        上传证件
                    </div>
                </td>
            </tr>
            <tr>
                <td class="td-title">板车及设备照片</td>
                <td class="td-row2 td-value1" colspan="4">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in exitParmsList.devicePictures">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link"
                                                                      @click="deleteFiles('exit','devicePictures',i)">删除</a>
                            </div>
                        </div>
                    </div>
                </td>
                <td>
                    <div v-if="showInput('0')" id="exitdevicePictures" class="rightBorder fj fujian">
                        上传照片
                    </div>
                </td>
            </tr>
            <tr>
                <td rowspan="2" class="td-title" style="line-height: 48px">备注</td>
                <td rowspan="2" class="td-value2" colspan="5">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="exitParmsList.main.remark"/>
                    <span v-else class="pull-left lineOne"
                          style="margin-left: 10px">{{exitParmsList.main.remark}}</span>
                </td>
            </tr>
            <tr></tr>
            </tbody>
        </table>
        <table id="move" class="table-detail">
            <tr class="no-print">
                <td colspan="6" class=" no-print title">移库记录</td>
            </tr>
            <span style="display: none" class="td-title" style="display: none" id="moveTime">移库时间  {{formatDate(moveParmsList.main.createTime)}}</span>
            <tbody>
            <tr>
                <td class="td-title" style="width:15.8%">出库类型</td>
                <td class="td-row2 width90 td-value1" style="width:84.2%" colspan="5">
                    <span style="margin-left: 10px" class="pull-left ">移库</span>
                </td>
            </tr>
            <tr>
                <td style="width: 15.8%" class="td-title">原库存地</td>
                <td class="td-value2" style="width: 17.5%">
                    <select v-if="showInput('0')" class=" td-row2 td-value" id="testMoveState"
                            v-model="moveParmsList.main.pickUpAddress" @change="getOldContactAndTel()">
                        <option value=""></option>
                        <option v-for="option in stocks" :value="option.stockArea">{{option.stockArea}}</option>
                    </select>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{moveParmsList.main.pickUpAddress}}</span>
                </td>
                <td style="width: 15.8%;" class="td-title">联系人</td>
                <td class="td-value2" style="width:17.5%">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.pickUpContacts"/>
                    <span v-else class="text-left  lineSpan" style="margin-left: 10px" type="text">{{moveParmsList.main.pickUpContacts}}</span>
                </td>

                <td style="width: 15.8%;" class="td-title">电话</td>
                <td class="td-value2" style="width:17.5%">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.pickUpTelephone"/>
                    <span v-else class="text-left  lineSpan" style="margin-left: 10px" type="text">{{moveParmsList.main.pickUpTelephone}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">新库存地</td>
                <td class="td-value2" style="width: 233px">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.delivery_address"/>
                    <span v-else class="pull-left lineSpan" style="margin-left: 10px">{{moveParmsList.main.delivery_address}}</span>
                </td>
                <td class="td-title">联系人</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.deliveryContacts"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{moveParmsList.main.deliveryContacts}}</span>
                </td>
                <td class="td-title">电话</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.deliveryTelephone"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{moveParmsList.main.deliveryTelephone}}</span>
                </td>
            </tr>

            <tr>
                <td class="td-title">运输公司</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           id="moveTraCompany" showList="true" v-model="moveParmsList.main.transport_company"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{moveParmsList.main.transport_company}}</span>
                </td>
                <td class="td-title">联系人</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.contacts"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{moveParmsList.main.contacts}}</span>
                </td>
                <td class="td-title">电话</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.telephone"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{moveParmsList.main.telephone}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">板车车牌</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.dray_license"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{moveParmsList.main.dray_license}}</span>
                </td>
                <td class="td-title">司机姓名</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.driver_name"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{moveParmsList.main.driver_name}}</span>
                </td>
                <td class="td-title">司机电话</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.driver_tel"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{moveParmsList.main.driver_tel}}</span>
                </td>
            </tr>
            <tr>
                <td class="td-title">运费（含专票)/元</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'moveParmsList.main.special_fee')"
                           @focus="strFormatF($event.target,'moveParmsList.main.special_fee')"
                           v-onedate="fmoney(moveParmsList.main.special_fee)"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{fmoney(moveParmsList.main.special_fee)}}</span>
                    <!--  <span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款(元)</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           @blur="strFormat($event.target,'moveParmsList.main.deduction_fee')"
                           @focus="strFormatF($event.target,'moveParmsList.main.deduction_fee')"
                           v-onedate="fmoney(moveParmsList.main.deduction_fee)"/>
                    <span v-else class="pull-left " style="margin-left: 10px">{{fmoney(moveParmsList.main.deduction_fee)}}</span>
                    <!--<span style="position:absolute;left:105px;top: 0px;">元</span>-->
                </td>
                <td class="td-title">扣款说明</td>
                <td class="td-value2">
                    <input v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.deduction_remark"/>
                    <span v-else class="pull-left lineOne" style="margin-left: 10px">{{moveParmsList.main.deduction_remark}}</span>
                </td>
            </tr>
            <tr>
                <td style="width: 211px;" class="td-title">运输开始日期</td>
                <td class="td-value2" style="width: 233px">

                    <input class="text-left" @focus="showDatePicker($event,'move','transportStartTime')"
                           v-if="showInput('0')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.transportStartTime"/>
                    <span v-else class="pull-left "
                          style="margin-left: 10px">{{moveParmsList.main.transportStartTime}}</span>
                </td>
                <td class="td-title">运输结束日期</td>
                <td class="td-value2">

                    <input class="text-left" @focus="showDatePicker($event,'move','transportEndTime')"
                           v-if="showInput('移库运输结束日期')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.transportEndTime"/>
                    <span v-else="pageType=='look'" class="pull-left " style="margin-left: 10px">{{moveParmsList.main.transportEndTime}}</span>
                </td>
                <td class="td-title">司机证件</td>
                <td class="td-row2 td-value1">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in moveParmsList.certificates">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link"
                                                                      @click="deleteFiles('move','certificates',i)">删除</a>
                            </div>
                        </div>
                    </div>
                    <div v-if="showInput('0')" id="movecertificates" class="rightBorder fj fujian">
                        上传证件
                    </div>
                </td>
            </tr>
            <tr>
                <td class="td-title">板车及设备照片</td>
                <td class="td-row2 td-value1" colspan="4">
                    <div id="divUploadedFiles">
                        <div class="fj-tanzhongStyle " v-for="(attach,i) in moveParmsList.devicePictures">
                            <b :class="fjStyle(attach.name)"></b>
                            <div class="name" v-if="attach.name" :title="attach.name"
                                 v-on:click="download(attach.url,attach.name)">{{attach.name}}
                            </div>
                            <div class="down"><a href="javascript:void(0)" class="nui-txt-link"
                                                 v-on:click="download(attach.url,attach.name)">下载</a></div>
                            <div class="del" v-if="showInput('0')"><a href="javascript:void(0)" class="nui-txt-link"
                                                                      @click="deleteFiles('move','devicePictures',i)">删除</a>
                            </div>
                        </div>
                    </div>
                </td>
                <td>
                    <div v-if="showInput('0')" id="movedevicePictures" class="rightBorder fj fujian">
                        上传照片
                    </div>
                </td>
            </tr>
            <tr>
                <td rowspan="2" class="td-title" style="line-height: 48px">备注</td>
                <td rowspan="2" class="td-value2" colspan="5">
                    <input v-if="showInput('移库备注')" style="width: 100%;border: 0px" type="text"
                           v-model="moveParmsList.main.remark"/>
                    <span v-else class="pull-left lineOne"
                          style="margin-left: 10px">{{moveParmsList.main.remark}}</span>
                </td>
            </tr>
            <tr></tr>
            </tbody>
        </table>
        <!--审批进度-->
        <table v-if="pageType!='add'" class="table-detail no-print" style="border-top-width:0px;">
            <tr>
                <td class=" title" colspan="4">审批进度</td><!--td-module-->
            </tr>
            <tr>
                <td class="td-title" style="width:17%;">审核人员</td>
                <td class="td-title" style="width:16%;">审核状态</td>
                <td class="td-title" style="width:17%;">审核时间</td>
                <td class="td-title">审核意见</td>
            </tr>
            <tr>
                <td>
                    <span>{{sampleParmsList.main.auditName}}-{{sampleParmsList.main.auditRoleName}}</span>
                </td>
                <td>
                    <span v-if="sampleParmsList.main.auditFlag==0" style="color:red;">{{convertAuditFlagToName(sampleParmsList.main.auditFlag)}}</span>
                    <span v-else>{{convertAuditFlagToName(sampleParmsList.main.auditFlag)}}</span>
                </td>
                <td><span v-if="sampleParmsList.main.auditFlag!=0">{{sampleParmsList.main.auditTime}}</span></td>
                <td>
                    <span>{{sampleParmsList.main.auditAdvise}}</span>
                </td>
            </tr>
            <!--<tr v-for="itemAudit in auditHistorys">
                <td><span>{{itemAudit.auditorName}}</span></td>
                <td><span>{{convertAuditFlagToName(itemAudit.auditFlag)}}</span></td>
                <td><span>{{itemAudit.auditTime}}</span></td>
                <td><span>{{itemAudit.auditAdvise}}</span></td>
            </tr>-->
        </table>
    </div>
    <div class="south no-print" style="height:50px;line-height:50px;text-align:center;">
        <input type="button" style="margin-left:20px;" v-if="pageType=='add'"
               value="保存草稿" class="btn  btn-sm oaBtn" @click="addSample('draft')"/>
        <input type="button" style="margin-left:20px;" v-if="pageType=='add'"
               value="提交" class="btn oaBtn btn-sm" @click="addSample('add')"/>
        <input type="button" style="margin-left:20px;" v-if="pageType=='edit'"
               value="保存" class="btn oaBtn btn-sm" @click="update('save')"/>
        <input type="button" style="margin-left:20px;"
               v-if="pageType=='edit'&&(sampleParmsList.main.auditFlag==2||sampleParmsList.main.auditFlag==-1)"
               value="提交" class="btn oaBtn btn-sm" @click="update('add')"/>
        <input type="button" class="btn oaBtn btn-sm" @click="audit('tongguo')" value="通过"
               style="margin-left: 30px ;margin-top: 5px;"
               v-if="sampleParmsList.main.auditId==userId&&sampleParmsList.main.auditFlag==0">
        <input type="button" class="btn oaBtn btn-sm" @click="audit('bohui')" value="驳回"
               style="margin-left: 20px ;margin-top: 5px;"
               v-if="sampleParmsList.main.auditId==userId&&sampleParmsList.main.auditFlag==0">
        <!--<input type="button" style="margin-left:20px;" v-if="pageType=='edit'"-->
        <!--value="保存" class="btn btn-primary btn-sm" @click="update()">-->
    </div>
</div>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=63aed32f"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="/dist/js/pages/apply/money/class.js"></script>
<script type="text/javascript" src="/dist/js/pages/system/systemService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/print/print.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/js/pages/wreport/Template.js?t=42e28def"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineSpan", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
    $(function () {
        $("body").on("click", ".ssx", function (e) {
            if ($(".model-picker-dropdown").is(":hidden")) {
                $(".model-picker-dropdown").css({
                    "width": $(this).outerWidth() + "px",
                    "left": $(this).offset().left,
                    "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                }).show();
                e.stopPropagation();
            } else {
                $(".model-picker-dropdown").hide();
            }
        });
        $("body").on("click", ".model-select-tab a", function (e) {
            $(this).parent().find("a").removeClass("active");
            $(this).addClass("active");
            var boxName = $(this).attr("data-count");
            $(".model-select").hide();
            $(".model-select-content" + " ." + boxName).show();
        });
        $("body").on("click", ".model-select  a", function (e) {
            if ($(this).hasClass("active")) {
                return false;
            }
            $(this).parent().find("a").removeClass("active");
            var id = $(this).attr("attr-id");
            $(this).addClass("active");
            var val = $(this).text();
            if ($(this).parents(".model-select").hasClass("type")) {
                $(".model-select-tab a").removeClass("active");
                $(".model-select-tab a[data-count=brand]").addClass("active");
                $(".model-select").hide();
                app.sampleParmsList.main.provinceName = val;
                app.sampleParmsList.main.cityName = '';
                app.sampleParmsList.main.countyName = '';
                app.getCity(id);
                $(".model-select-content .brand").show();
            } else if ($(this).parents(".model-select").hasClass("brand")) {
                $(".model-select-tab a").removeClass("active");
                var id = $(this).attr("attr-id");
                $(".model-select-tab a[data-count=model]").addClass("active");
                $(".model-select").hide();
                app.sampleParmsList.main.cityName = val;
                app.sampleParmsList.main.countyName = '';
                app.getCounty(id);
                $(".model-select-content .model").show();

            } else {
                app.sampleParmsList.main.countyName = val;
                $(".model-picker-dropdown").hide();
            }
        })
        $("body").on("click", ".model-picker-dropdown", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".model-picker-dropdown").hide();
        });
    });
    $(function () {
        $("body").on("click", ".moreList", function (e) {
            var tableName = $(this).attr("data-table");
            var column = $(this).attr("data-column");
            var columnName = $(this).attr("data-columnName");
            var mainKey = $(this).attr("data-column");
            var mid = $(this).attr("data-mid");
            var type = $(this).attr("data-type");
            if ($(this).hasClass("jiaobiao3")) {
                $.dialog({
                    content: 'url:/page/logs/logs.html?tableName=' + tableName + '&column=' + column + '&columnName=' + columnName + "&mainKey=" + mainKey + "&mid=" + mid + '&type=' + type + '&id=' + app.sampleParmsList.main.id,
                    title: '修改日志',
                    width: 600,
                    height: 500,
                    max: false,
                    min: false,
                    lock: true
                });
            }
        });
        $("body").on("click", ".moreListData", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".moreListData").hide();
        });
    });

    function refresh() {
        location.reload();
    }
</script>
<script type="text/javascript">
    //var api = frameElement.api, W = api.opener;

    function refresh() {
    }

    Vue.directive('onedate', {
        // 当被绑定的元素插入到 DOM 中时……
        update: function (el, binding) {
            // 聚焦元素
            if (app.pageType != 'add') {
                if (el.value == "NaN.undefined" || el.value == "") {
                    el.value = binding.value
                }
            }
        },
        componentUpdated: function (el, binding) {
            // 聚焦元素


        }
    })
    var app = new Vue({
        el: "#app",
        data: {
            clickItem: '',
            openType: $.wyui.page.urlParams.openType ? $.wyui.page.urlParams.openType : 'top',
            storeDuration: '',
            provinceId: '省份',
            cityId: '市区',
            countyId: '县',
            userId: getCurrentUser().id,
            state: [],
            oldState: '',
            /*  state: [
             { value: '库存'},
             { value: '提车在途'},
             { value: '移库在途'},
             { value: '退货在途'}
             ],//状态*/
            auditHistorys: [],//历史审核记录
            stocks: [],//库存
            factorys: [],//厂家
            factoryContacts: [],//厂家
            buckets: [],//铲斗类型
            bucketCapacitys:[],//斗容
            paymentSituation: [],//付款情况
            payment: [],//付款方式
            payees: [],
            index: "0",
            currentUser: getCurrentUser(),
            pageType: "add",
            selectStock: "请选择库存地",
            selectBucketCapacity: "请选择斗容",
            selectBucketType: "请选择铲斗类型",
            selectCom: "购车公司",
            selectBran: "请选择品牌",
            selectMod: "请选择型号",
            selectType: "请选择设备类型",
            selectState: "",
            selectPayment: "请选择付款方式",
            selectStatus: "请选择付款情况",
            today: new Date().Format("yyyy-MM-dd"),
            itemsType: [],
            itemsCom: [],
            itemsBran: [],
            itemsMod: [],
            itemState: [],
            itemPro: [],
            itemCity: [],
            itemCounty: [],
            outboundParmsList: {
                certificates: [],//司机证件
                devicePictures: [],//设备照片
                drayPictures: [],//板车照片
                main: {
                    id: '',
                    sampleId: '',
                    trafficDestination: '',
                    trafficStarting: '',
                    transport_company: '',
                    contacts: '',
                    telephone: '',
                    dray_license: '',
                    driver_name: '',
                    driver_tel: '',
                    special_fee: '',
                    deduction_fee: '',
                    deduction_remark: '',
                    reason: '',
                    type: '',
                    pickUpAddress: '',
                    pickUpContacts: '',
                    pickUpTelephone: '',
                    delivery_address: '',
                    deliveryContacts: '',
                    deliveryTelephone: '',
                    remark: '',
                    contractId: '',
                    createTime: '',
                    transportStartTime: '',
                    transportEndTime: '',
                },
            },
            moveParmsList: {
                certificates: [],//司机证件
                devicePictures: [],//设备照片
                drayPictures: [],//板车照片
                main: {
                    id: '',
                    sampleId: '',
                    trafficDestination: '',
                    trafficStarting: '',
                    transport_company: '',
                    contacts: '',
                    telephone: '',
                    dray_license: '',
                    driver_name: '',
                    driver_tel: '',
                    special_fee: '',
                    deduction_fee: '',
                    deduction_remark: '',
                    reason: '',
                    type: '',
                    pickUpAddress: '',
                    pickUpContacts: '',
                    pickUpTelephone: '',
                    delivery_address: '',
                    deliveryContacts: '',
                    deliveryTelephone: '',
                    remark: '',
                    contractId: '',
                    createTime: '',
                    transportStartTime: '',
                    transportEndTime: '',
                },
            },
            exitParmsList: {
                certificates: [],//司机证件
                devicePictures: [],//设备照片
                drayPictures: [],//板车照片
                main: {
                    id: '',
                    sampleId: '',
                    trafficDestination: '',
                    trafficStarting: '',
                    transport_company: '',
                    contacts: '',
                    telephone: '',
                    dray_license: '',
                    driver_name: '',
                    driver_tel: '',
                    special_fee: '',
                    deduction_fee: '',
                    deduction_remark: '',
                    reason: '',
                    type: '',
                    pickUpAddress: '',
                    pickUpContacts: '',
                    pickUpTelephone: '',
                    delivery_address: '',
                    deliveryContacts: '',
                    deliveryTelephone: '',
                    remark: '',
                    contractId: '',
                    createTime: '',
                    transportStartTime: '',
                    transportEndTime: '',
                },
            },
            logisticParmsList: {
                certificates: [],//司机证件
                devicePictures: [],//设备照片
                drayPictures: [],//板车照片
                main: {
                    id: '',
                    reason: '',
                    trafficDestination: "",
                    trafficStarting: "",
                    transportCompany: "",
                    contacts: "",
                    telephone: "",
                    drayLicense: "",
                    driverName: "",
                    driverTel: "",
                    specialFee: "",
                    deductionFee: "",
                    deductionRemark: "",
                    createTime: '',
                    transportStartTime: '',
                    transportEndTime: '',
                },
            },
            sampleParmsList: {
                attaches: [],//提货信息中附件
                certificates: [],//司机证件
                devicePictures: [],//设备照片
                drayPictures: [],//板车照片
                main: {
                    id: '',
                    companyName: '',
                    brandName: "",
                    deviceTypeName: "",
                    modelName: "",
                    fkBrandId: '',
                    fkDeviceTypeId: '',
                    fkModelId: '',
                    fkCompanyId: '',
                    state: "",
                    storeAddress: "",
                    sequence: "",
                    pickUpAddress: "",
                    pickUpType: "",
                    pickUpDate: "",
                    trafficDestination: "",
                    trafficStarting: "",
                    trafficFee: "",
                    trafficCompany: "",
                    orderSupport: "",
                    remark: "",
                    picture: "",
                    //合格证
                    certificationAttachName: '',
                    certificationAttachUrl: '',
                    //发票
                    invoiceAttachName: '',
                    invoiceAttachUrl: '',
                    //铭牌
                    namePlateAttachName: '',
                    namePlateAttachUrl: '',
                    //司机证件
                    driverAttachName: '',
                    driverAttachUrl: '',
                    //随机配件
                    deviceAnnex: '',
                    partsAttachName: '',
                    partsAttachUrl: '',
                    deviceParts: '',
                    tonConfig: 0,
                    bucketCapacity: "",
                    bucketType: "",
                    productionDate: "",
                    storeDuration: "",
                    financing: "是",
                    payment: "",
                    pickupPrice: "",
                    financingAmount: "",//融资放款金额
                    partsPrice: "",
                    partsRemark: "",
                    paymentStatus: "",
                    settle: "否",
                    freeMaturityDate: "",
                    factoryContacts: "",
                    factoryTel: "",
                    shuttleContacts: "",
                    shuttleTel: "",
                    transportCompany: "",
                    contacts: "",
                    telephone: "",
                    drayLicense: "",
                    deliveryAddress: "",
                    driverName: "",
                    driverTel: "",
                    specialFee: "",
                    deductionFee: "",
                    deductionRemark: "",
                    drillDiameter: "",
                    maxCapacity: "",
                    stockTime: '',
                    createTime: '',
                    transportStartTime: '',
                    transportEndTime: '',
                    createUserId: getCurrentUser().id,
                    createUserName: getCurrentUser().name,
                    updateUserId: getCurrentUser().id,
                    updateUserName: getCurrentUser().name,
                    auditFlag: -1,
                    auditId: '',
                    auditName: '',
                    auditRoleName: '',
                    auditTime: '',
                    auditAdvise: '',
                    actualDeliveryDate: '',
                    provinceName: '',
                    cityName: '',
                    countyName: '',
                    accessoriesRemark: '',
                    configurationNo:''
                }
            },
            contract: {
                id: "",
                buyType: "",
                zhihuan: "",
                diankuan: "",
                regionManagerName: "",
                regionManagerId: "",
                companyId: "",
                contractType: ""
            },
            RepaymentPlanList: [//还款计划表
                new Template.RepaymentPlan('')
            ],
            deviceParts: [],
            RepaymentPlanNum: {
                repaymentAmountCount: '',
                interestCount: '',
                actualRepaymentAmountCount: '',
                remainingArrearsCount: ''
            },
            uploader: null,
        },
        methods: {
            remarks: function (item) {
                this.clickItem = item;
                var html = ""
                html = '<textarea style="width:95%;margin: 0 auto;outline: none;resize: none;" rows="10" cols="30" id="printText" class="printInput"></textarea><input class="btn oaBtn btn-sm printBtn" type="button" value="确认" style="margin-left: 35%;" onclick="app.pok()">';
                $.dialog({
                    content: html,
                    title: '请填写备注信息',
                    width: 350,
                    max: false,
                    min: false,
                    lock: true
                });
                $("#printText").text(item.remark);
            },
            pok: function () {
                this.clickItem.remark = $("#printText").val()
                $(".ui_close").click();
            },
            showCon: function () {
                var that = this;
                if (that.sampleParmsList.main.storeAddress == "直发客户交机" && that.selectState == "已交") {
                    $("#con").show();
                }
            },
            showToday: function (updateTime) {
                var dateTime = new Date().Format("yyyy-MM-dd");
                if (dateTime == updateTime) {
                    return true;
                } else {
                    return false;
                }
            },
            getNumber: function (number) {
                switch (number) {
                    case 1:
                        return '一';
                        break;
                    case 2:
                        return '二';
                        break;
                    case 3:
                        return '三';
                        break;
                    case 4:
                        return '四';
                        break;
                    case 5:
                        return '五';
                        break;
                    case 6:
                        return '六';
                        break;
                    case 7:
                        return '七';
                        break;
                    case 8:
                        return '八';
                        break;
                    case 9:
                        return '九';
                        break;
                    case 10:
                        return '十';
                        break;
                }
            },
            beforeshow: function () {
                var that = this;
                var demo = $(this);
                var name = "namePlateAttach";
                var nameValue = name + "Name";
                var uploader = WebUploader.create({
                    // 选完文件后，是否自动上传。
                    auto: true,
                    // swf文件路径
                    swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    // 文件接收服务端。
                    server: server.fjIp + "/attach/uploadFile.json",
                    // 选择文件的按钮。可选。
                    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    pick: '#' + name,
                    duplicate: true
                });
                // 文件上传过程中创建进度条实时显示。
                uploader.on('uploadProgress', function (file, percentage) {
                    var $li = $('#' + file.id),
                        $percent = $li.find('.progress span');
                    // 避免重复创建
                    if (!$percent.length) {
                        $percent = $('<p class="progress"><span></span></p>')
                            .appendTo($li)
                            .find('span');
                    }
                    $percent.css('width', percentage * 100 + '%');
                });
                uploader.on("uploadStart", function () {
                    $("#progress").show();
                });
                uploader.on("uploadComplete", function () {
                    $("#progress").hide();
                });
                // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                uploader.on('uploadSuccess', function (file, response) {
                    var nameValue = name + "Name";
                    var urlValue = name + "Url";
                    that.sampleParmsList.main[nameValue] = response.name;
                    that.sampleParmsList.main[urlValue] = response.url;
                    $("#" + name).hide();
                });
                // 文件上传失败，显示上传出错。
                uploader.on('uploadError', function (file) {
                    alert("上传失败！");
                });
            },
            beforeshow2: function () {
                var that = this;
                var demo = $(this);
                var name = "partsAttach";
                var nameValue = name + "Name";
                var uploader = WebUploader.create({
                    // 选完文件后，是否自动上传。
                    auto: true,
                    // swf文件路径
                    swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    // 文件接收服务端。
                    server: server.fjIp + "/attach/uploadFile.json",
                    // 选择文件的按钮。可选。
                    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    pick: '#' + name,
                    duplicate: true
                });
                // 文件上传过程中创建进度条实时显示。
                uploader.on('uploadProgress', function (file, percentage) {
                    var $li = $('#' + file.id),
                        $percent = $li.find('.progress span');
                    // 避免重复创建
                    if (!$percent.length) {
                        $percent = $('<p class="progress"><span></span></p>')
                            .appendTo($li)
                            .find('span');
                    }
                    $percent.css('width', percentage * 100 + '%');
                });
                uploader.on("uploadStart", function () {
                    $("#progress").show();
                });
                uploader.on("uploadComplete", function () {
                    $("#progress").hide();
                });
                // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                uploader.on('uploadSuccess', function (file, response) {
                    var nameValue = name + "Name";
                    var urlValue = name + "Url";
                    that.sampleParmsList.main[nameValue] = response.name;
                    that.sampleParmsList.main[urlValue] = response.url;
                    $("#" + name).hide();
                });
                // 文件上传失败，显示上传出错。
                uploader.on('uploadError', function (file) {
                    alert("上传失败！");
                });
            },
            showDz: function () {
                var html = '';
                if (this.sampleParmsList.main.provinceName) {
                    html += this.sampleParmsList.main.provinceName;
                }
                if (this.sampleParmsList.main.cityName != '') {
                    html += "-" + this.sampleParmsList.main.cityName;
                }
                if (this.sampleParmsList.main.countyName != '') {
                    html += "-" + this.sampleParmsList.main.countyName;
                }
                return html;
            },
            hiddenDivModel: function () {
                $("#countyIdel").hide();
            },
            getIntentionModel: function () {
                var that = this;
                that.sampleParmsList.main.provinceName = $("#provinceN option:selected").text();
                that.sampleParmsList.main.cityName = $("#cityN option:selected").text();
                that.sampleParmsList.main.countyName = $("#countyN option:selected").text();
                $("#countyIdel").hide();
            },
            getCounty: function (id) {
                var that = this;
                $.wyui.postMethod('/intentCustomer/getForProvinceById.json', {'id': id}, function (r) {
                    console.log(r);
                    that.itemCounty = r.records;
                })

            },
            getCity: function (id) {
                var that = this;
                that.cityId = "市区";
                that.countyId = "县";
                var data = {};
                $.wyui.postMethod('/intentCustomer/getForProvinceById.json', {'id': id}, function (r) {
                    console.log(r);
                    that.itemCity = r.records;
                })
            },
            showDivModel: function (event) {
                console.log(event)
                $("#countyIdel").css({
                    "left": event.pageX,
                    "top": (event.pageY) + "px"
                }).show();
            },

            selContract: function (modelName) {
                $.dialog({
                    content: 'url:contractList.html?modelName=' + modelName,
                    title: '选择合同',
                    width: 904,
                    height: 665,
                    max: true,
                    min: true,
                    lock: true
                });

            },
            goDetail: function (type, i) {
                top.closeTabByPageId("contractDetail");
                var that = this;
                var id = that.contract.id;
                var buyType = that.contract.buyType;
                var zhihuan = that.contract.haveReplacement;
                var diankuan = that.contract.haveRepayment;
                var regionManagerName = that.contract.regionManagerName;
                var regionManagerId = that.contract.regionManagerId;
                var companyId = that.contract.sellerCompanyId;
                var contractType = that.contract.contractType;
                var condition = '?id=' + id + '&buyType=' + buyType + '&zhihuan=' + zhihuan + '&diankuan=' + diankuan
                    + '&regionManagerId=' + regionManagerId + '&regionManagerName=' + regionManagerName + '&contractType=' + contractType + '&companyId=' + companyId;
                if (type == '审核' || type == '查看') {
                    condition += '&pageType=look';
                    var haveHistory = false;
                    $.wyui.postLoadMethod("/contractMain/getHtmlHistory.json", {mainId: id}, function (r) {
                        if (r.result && r.result.html) {
                            haveHistory = true;
                        }
                        console.log(haveHistory)
                        if (haveHistory) {
                            top.addTabs({
                                id: 'contractDetail',
                                title: '合同详情',
                                close: true,
                                url: 'apply/contract/detail_history.html' + condition + '&mainId=' + id,
                            });
                        } else {
                            top.addTabs({
                                id: 'contractDetail',
                                title: '合同详情',
                                close: true,
                                url: 'apply/contract/detail_new.html' + condition
                            });
                        }

                    }, false, true);
                }
                if (type == '编辑') {
                    condition += '&pageType=edit';
                    top.addTabs({
                        id: 'contractDetail',
                        title: '修改合同',
                        close: true,
                        url: 'apply/contract/detail_new.html' + condition
                    });
                }
                if (type == '下载') {
                    $('#ifExprot').attr('src', server.ip
                        + "/contractMain/downResumeDoc.json"
                        + '?contractId=' + id)
                    ;
                    return false;
                }
                if (type == '上传附件') {
                    top.$.dialog({
                        content: 'url:/page/apply/contract/uploadFile.html?contractId=' + id,
                        title: '上传附件',
                        width: 420,
                        height: 500,
                        max: true,
                        min: true,
                        lock: true
                    });
                    return false;
                }
            },
            getConfig: function (tonString) {
                ton = parseInt(tonString)
                if (ton == "NAN") {
                    return ""
                } else {
                    if (ton < 10) {
                        return "小挖机"
                    } else if (ton > 10 && ton < 30) {
                        return "中挖机"
                    } else if (ton >= 30) {
                        return "大挖机"
                    }
                }
                //auditFlag:-1,0,1,2,3,4,5,6

            },
            convertAuditFlagToName: function (auditFlag) {
                //auditFlag:-1,0,1,2,3,4,5,6
                switch (auditFlag) {
                    case -1:
                        return "未提交";
                        break;
                    case 0:
                        return "审核中";
                        break;
                    case 1:
                        return "通过";
                        break;
                    case 2:
                        return "驳回";
                        break;
                    default :
                        break;
                }
            },
            bucketmanager: function (brandId, deviceTypeId, modelId) {
                if (modelId == "" || modelId == "请选择型号") {
                    alert("请先选择型号")
                    return false;
                }
                $.dialog({
                    content: 'url:/page/device/manage/detail.html?closeType=edit&&type=edit&&id=' + modelId,
                    title: '修改设备信息',
                    width: 904,
                    height: 365,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            modelmanager: function (brandId, deviceTypeId) {
                $.dialog({
                    content: 'url:/page/device/manage/detail.html?closeType=close&&brandId=' + brandId + "&&deviceTypeId=" + deviceTypeId,
                    title: '添加设备',
                    width: 904,
                    height: 565,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            audit: function (type) {
                var that = this;
                if (type == 'tongguo') {
                    if (!confirm("确定要通过吗？")) {
                        return;
                    }
                    $.wyui.postMethod('/deviceSample/applyAudit.json', {
                            id: that.sampleParmsList.main.id,
                            auditFlag: 1,
                            advise: '同意!',
                            userId: getCurrentUser().id,
                        },
                        function (r) {
                            if (that.openType == 'top') {
                                alert('审核成功');
                                var pageId = top.getActivePageId();
                                var $iframe = top.findIframeByName("库存管理");
                                $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.app.sel();
                                top.closeTabByPageId(pageId);
                            } else {
                                alert('审核成功');
                                window.location.href = "detail_new.html?pageType=look&&id=" + that.sampleParmsList.main.id;
                            }


                            /*var $iframe = top.findIframeByName("库存管理");
                             $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.app.sel();
                             api.close();*/
                        }
                    )
                    ;
                } else {
                    that.copierReturn();
                    //alert('请填写审核意见');
                    return;
                }
            },
            copierReturn: function () {
                var that = this;
                $.dialog({
                    content: 'url:/page/device/sample/newDeviceCopierReturnReason.html?id=' + that.sampleParmsList.main.id + "&type=3&openType=" + that.openType,
                    title: '填写驳回原因',
                    width: 300,
                    height: 200,
                    max: false,
                    min: false,
                    lock: true
                });
            }
            ,
            formatDate: function (now) {
                return new Date(now).Format(TimeFormat.long)
            },
            fmoney: function (s, n) {
                n = n > 0 && n <= 20 ? n : 2;
                s = parseFloat((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
                var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1],
                    t = "";
                for (i = 0; i < l.length; i++) {
                    t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
                }
                return t.split("").reverse().join("") + "." + r;
            },
            strFormat: function (target, data) {
                //此结果为了展示数据
                var fu=false;
                var value = (target.value).trim();
                if(value<0){
                    fu=true;
                }
                value = value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g, '');
                if (!value) {
                    value = 0;
                }
                if(fu){
                    value="-"+value
                }
                //此结果为data存入数据
                var dataList = data.split('.');
                if (dataList.length > 0) {
                    if (dataList.length == 1) {
                        this[dataList[0]] = value;
                    }
                    if (dataList.length == 2) {
                        this[dataList[0]][dataList[1]] = value;
                    }
                    if (dataList.length == 3) {
                        this[dataList[0]][dataList[1]][dataList[2]] = value;
                    }
                    if (dataList.length == 4) {
                        this[dataList[0]][dataList[1]][dataList[2]][dataList[3]] = value;
                    }
                    if (dataList.length == 5) {
                        this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]] = value;
                    }
                }
                target.value =this.fmoney(value);
                console.log('失去焦点'+target.value)
            },
            strFormatF: function (target, data) {
                var fu=false;
                var value = '';
                var dataList = data.split('.');

                if (dataList.length > 0) {
                    if (dataList.length == 1) {
                        value = this[dataList[0]]
                    }
                    if (dataList.length == 2) {
                        value = this[dataList[0]][dataList[1]]
                    }
                    if (dataList.length == 3) {
                        value = this[dataList[0]][dataList[1]][dataList[2]]
                    }
                    if (dataList.length == 4) {
                        value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]]
                    }
                    if (dataList.length == 5) {
                        value = this[dataList[0]][dataList[1]][dataList[2]][dataList[3]][dataList[4]]
                    }
                }
                if (!value || value == '0.00') {
                    console.log('获取焦点', value)
                    value = '';
                }
                target.value = value;
                console.log('获取焦点'+target.value)
            },
            openImg: function (url) {
                top.$.dialog({
                    title: '图片详情',
                    content: 'url:/page/showImg.html?url=' + url,
                    height: 500,
                    max: true,
                    min: false,
                    lock: true
                }).max();
            },
            changeState: function () {
                var that = this;
                if (that.selectStock == "直发客户交机") {
                    that.selectState = "交付在途";
                }
            },
            getBran: function () {
                var that = this;
                var s = that.selectCom;
                that.selectBran = '请选择品牌';
                that.selectType = '请选择设备类型';
                that.selectMod = '请选择型号';
                that.selectStock = '请选择库存地';
                that.selectBucketType = '请选择铲斗配置';
                that.selectBucketCapacity = '请选择斗容';
                var data = {'companyId': s.toString()};
                $.wyui.postMethod('/deviceBrand/getBrandByCompanyId.json', data, function (r) {
                    that.itemsBran = r.brands;
                })
                $.wyui.postMethod('/company/getCompanyById.json', {id: s.toString()}, function (r) {
                    that.stocks = r.stock;
                })
            },
            /*根据companyId获取品牌*/
            getType: function () {
                var that = this;
                that.selectType = '请选择设备类型';
                that.selectMod = '请选择型号';
                that.selectStock = '请选择库存地';
                that.selectBucketType = '请选择铲斗配置';
                that.selectBucketCapacity = '请选择斗容';
                var s = that.selectCom;
                var b = that.selectBran;
                var data = {'companyId': s.toString(), 'brandId': b.toString()};
                $.wyui.postMethod('/deviceBrand/getDeviceTypeList.json', data, function (r) {
                    $("#selBran").hide();
                    $("#selType").hide();
                    that.itemsType = r.devicetypes;
                });
                $.wyui.postMethod('/deviceBrand/getBankAndAccount.json', {brandId: that.selectBran}, function (data) {
                    that.payees = data;
                });
                $.wyui.postMethod('/brandStrock/selectByBrandId.json', {
                    brandId: that.selectBran,
                    type: 'distinct'
                }, function (data) {
                    that.factorys = data;
                });
            },
            showInput: function (type) {
                var pageType = $.wyui.page.urlParams.pageType;
                //草稿、驳回状态可重新编辑
                var auditFlag = $.wyui.page.urlParams.auditFlag;
                var state = $.wyui.page.urlParams.state;
                var storeAddress = $.wyui.page.urlParams.storeAddress;
                if (auditFlag == "-1" || (auditFlag == "2" && state == '提车在途') || (auditFlag == "2" && state == '交付在途') && storeAddress == '直发客户交机') {
                    pageType = 'add';
                }
                /*if((auditFlag=="-1"||auditFlag=="2")&&state=='提车在途'){
                 pageType='add';
                 }*/
                var str1 = "描述、随机配件、随机附件、移库备注、出库运输结束日期、出库司机姓名、出库司机电话、出库板车车牌、出库运输公司电话、出库运输公司联系人、出库运费含专票、退货运费含专票、退货运输公司、运费含专票、铲斗类型、斗容、型号、生产日期、提货价格、随机附件、付款情况、铭牌照片、入库日期、状态、备注、到期还款计划、提货合同、发票附件、合格证、付款方式、免息期到期日、客户是否融资、是否已结清、融资放款金额、附件备注、到期还款计划、扣款、扣款说明、司机证件、板车及设备照片、运输结束日期、实际交车日期、物流信息、更改入库物流信息、退货运输结束日期、移库运输结束日期、入库运输结束日期、库存地、板车车牌、运输开始日期、司机姓名、司机电话";
                var str2 = "状态、备注、库存地、入库日期、铲斗配置、客户是否融资、是否已结清、到期还款计划";
                var str3 = "库存地、备注、入库日期、铲斗配置、到期还款计划";
                var str4 = "状态、备注、库存地、入库日期、铲斗配置、退货运输结束日期、物流信息";
                var str5 = "状态、备注、库存地、入库日期、铲斗配置、到期还款计划、入库运输结束日期、更改入库物流信息";
                var str6 = "状态、备注、库存地、入库日期、铲斗配置、到期还款计划、移库运输结束日期、更改入库物流信息";
                var str7 = "状态、备注、库存地、入库日期、入库日期、铲斗配置、到期还款计划、出库运输结束日期、更改入库物流信息、实际交车日期";
                var that = this;
                if (pageType == 'add') {
                    return true;
                }
                if (pageType == 'edit') {
                    if (str1.indexOf(type) != -1) {
                        return true;
                    } else {
                        return false;
                    }
                    /* if (that.oldState.indexOf('在途')!=-1&&str1.indexOf(type)!=-1&&that.oldState!='退货在途'){
                     return true;
                     }else*/
                    /* if (that.oldState == '库存' && str2.indexOf(type) != -1) {
                     return true;
                     }
                     else if (that.oldState == '寄存' && str2.indexOf(type) != -1) {
                     return true;
                     } else if (that.oldState == '已交' && str3.indexOf(type) != -1) {
                     return true;
                     } else if (that.oldState == '退货在途' && str4.indexOf(type) != -1) {
                     return true;
                     } else if (that.oldState == '提车在途' && str5.indexOf(type) != -1) {
                     return true;
                     } else if (that.oldState == '移库在途' && str6.indexOf(type) != -1) {
                     return true;
                     } else if (that.oldState == '交付在途' && str7.indexOf(type) != -1) {
                     return true;
                     } else {
                     return false;
                     }*/
                }
                if (pageType == 'look') {
                    return false;
                }
            },
            getAccount: function (payee, i) {
                var that = this;
                $.wyui.postMethod('/deviceBrand/getBankAndAccountById.json', {
                    brandId: that.selectBran,
                    bankName: payee
                }, function (data) {
                    that.RepaymentPlanList[i].payeeAccount = data.bankAccount
                    that.RepaymentPlanList[i].accountName = data.intermediaryBank;
                });
            },
            getFactoryContactAndTel: function () {
                var that = this;
                var data = {
                    address: that.sampleParmsList.main.trafficStarting
                }
                $.wyui.postMethod('/brandStrock/getContactsByAddress.json', data, function (data) {
                    that.factoryContacts = data;
                    /*that.sampleParmsList.main.factoryContacts=data.contact;
                     that.sampleParmsList.main.factoryTel=data.contactTel*/
                });
            },
            getFactoryTel: function () {
                var that = this;
                var data = {
                    address: that.sampleParmsList.main.trafficStarting,
                    contact: that.sampleParmsList.main.factoryContacts
                }
                $.wyui.postMethod('/brandStrock/getTelByContactByAddress.json', data, function (data) {
                    that.sampleParmsList.main.factoryTel = data.contactTel
                });
            },
            getDestinContactAndTel: function () {
                var that = this;
                var data = {
                    storeAddress: that.sampleParmsList.main.trafficDestination
                }
                $.wyui.postMethod('/company/getContactAndTelByAddress.json', data, function (data) {
                    that.sampleParmsList.main.shuttleContacts = data.contact;
                    that.sampleParmsList.main.shuttleTel = data.contactTel
                });
            },
            getOldContactAndTel: function () {
                var that = this;
                var data = {
                    storeAddress: that.moveParmsList.main.pickUpAddress
                }
                $.wyui.postMethod('/company/getContactAndTelByAddress.json', data, function (data) {
                    that.moveParmsList.main.pickUpContacts = data.contact;
                    that.moveParmsList.main.pickUpTelephone = data.contactTel
                });
            },
            showDatePicker: function (e, firstType, type, i) {
                var that = this;
                WdatePicker({
                    onpicked: function (dp) {
                        if (firstType == 0) {
                            that.RepaymentPlanList[i][type] = dp.cal.getNewDateStr();
                        } else if (firstType == "out") {
                            that.outboundParmsList["main"][type] = dp.cal.getNewDateStr();
                        } else if (firstType == "move") {
                            that.moveParmsList["main"][type] = dp.cal.getNewDateStr();
                        } else if (firstType == "exit") {
                            that.exitParmsList["main"][type] = dp.cal.getNewDateStr();
                        } else {
                            that.sampleParmsList[firstType][type] = dp.cal.getNewDateStr();
                        }
                        return true;
                    },
                    oncleared:function (dp) {
                        if(firstType == 0){
                            that.RepaymentPlanList[i].paymentDate = '';
                        }else {
//                            that.sampleParmsList.main.productionDate = '';//生产日期
//                            that.sampleParmsList.main.stockTime = '';//入库日期
                            that.sampleParmsList.main.actualDeliveryDate = '';//实际交车日期
                        }



//                        sampleParmsList.main.productionDate
                        return true;
                    }
                });
                $(e.target).blur();
            },
            /*根据brandId获得型号*/
            getMod: function () {
                var that = this;
                if ($("#testType option:selected").text().indexOf("挖掘机") >= 0 | $("#testType option:selected").text().indexOf("装载机") >= 0) {
                    $("#wjj").show();
                    $("td[name='psc']").hide();
                    $("td[name='sfj']").hide();
                } else if ($("#testType option:selected").text().indexOf("破碎锤") >= 0) {
                    $("#wjj").hide();
                    $("td[name='sfj']").hide();
                    $("td[name='psc']").show();
                } else if ($("#testType option:selected").text().indexOf("筛分机") >= 0 | $("#testType option:selected").text().indexOf("破碎机") >= 0) {
                    $("td[name='psc']").hide();
                    $("#wjj").hide();
                    $("td[name='sfj']").show();
                }
                that.selectMod = '请选择型号';
                that.selectStock = '请选择库存地';
                that.selectBucketType = '请选择铲斗配置';
                that.selectBucketCapacity = '请选择斗容';
                var deviceTypeId = that.selectType;
                var brandId = that.selectBran;
                that.buckets = "";
                var data = {'brandId': brandId, 'deviceTypeId': deviceTypeId};
                $.wyui.postMethod('/deviceModel/getModelListByBrandId.json', data, function (r) {
                    that.itemsMod = r.models;
                })
            },
            showBucket: function () {
                var that=this;
                $.wyui.postMethod('/deviceSample/selectBucketListByModelId.json', {modelId: that.selectMod,
                    bucketType:that.selectBucketType}, function (r) {
                    that.bucketCapacitys = r;
                })
            },
            showConfigurationNo: function(){
                var that = this;
                $.wyui.postMethod('/deviceSample/selectConfigurationNo.json', {modelId: that.selectMod,
                    bucketType:that.selectBucketType,bucketCapacity:that.selectBucketCapacity}, function (r) {
                    that.sampleParmsList.main.configurationNo = r.configurationNo;
                })
            },
            show: function () {
                var that = this;
                var deviceTypeId = that.selectType;
                var brandId = that.selectBran;
                var modelId = that.selectMod
                var type = that.type
                var index = that.index;//防止上传按钮多次渲染
                that.selectBucketType = "请选择铲斗配置"
                $.wyui.postMethod('/deviceSample/selectBucketListByModelId.json', {modelId: that.selectMod}, function (r) {
                    that.buckets = r;
                });

                $.wyui.postMethod('/device/getDeviceById.json', {id: that.selectMod}, function (r) {
                    that.sampleParmsList.main.tonConfig = r.tonConfig
                    if (that.sampleParmsList.main.tonConfig == "") {
                        that.sampleParmsList.main.tonConfig = 0;
                    }
                })
                if (deviceTypeId != "" && brandId != "" && modelId != "" && index == "0" && type == 'add') {
                    $("#pick").show();
                    $("#repayment").show();
                    $("#config").show();
                    $("#parts").show();
                    $("#transport").show();
                    $("#traCompany").autoComplete({
                        url: server.ip + "/brandStrock/getTransportCompany.json",
                        render: function (users, panel) {
                            for (var i = 0; i < users.length; i++) {
                                $("<li></li>").data("autoComplete",
                                    users[i]).html("<a>" + users[i].companyName + "&nbsp;&nbsp;&nbsp;" +
                                    "(" + "&nbsp;" + users[i].contact + "-" + users[i].tel + "&nbsp;" + ") " + "</a>")
                                    .appendTo(panel);
                            }
                        },
                        selected: function (user) {
                            app.sampleParmsList.main.transportCompany = user.companyName;
                            app.sampleParmsList.main.contacts = user.contact;
                            app.sampleParmsList.main.telephone = user.tel;
                            return false;
                        },
                        height: 210,
                        width: 320
                    });
                    that.init();
                    that.index = "";
                    this.uploader = WebUploader.create({
                        // 选完文件后，是否自动上传。
                        auto: true,
                        // swf文件路径
                        swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                        // 文件接收服务端。
                        server: server.fjIp + "/attach/uploadFile.json",
                        // 选择文件的按钮。可选。
                        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                        pick: '#divUpload',
                        duplicate: true
                    });
                    this.uploader.on("uploadStart", function () {
                        $("#progress").show();
                    });
                    this.uploader.on("uploadComplete", function () {
                        $("#progress").hide();
                    });
                    // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                    this.uploader.on('uploadSuccess', function (file, response) {
                        if (response._raw == "文件上传出错！") {
                            alert("文件上传出错！");
                        } else {
                            that.sampleParmsList.attaches.push({
                                id: response.id,
                                name: response.name,
                                url: response.url
                            });
                        }
                    });
                    // 文件上传失败，显示上传出错。
                    this.uploader.on('uploadError', function (file) {
                        alert("上传失败！");
                    });
                }
            },
            goBack: function () {
                api.close();
            },
            deleteFiles: function (firstType, type, i) {
                if (window.confirm("确定要删除该附件吗?")) {
                    if (firstType == "move") {
                        this.moveParmsList[type].splice(i, 1);
                    } else if (firstType == "out") {
                        this.outboundParmsList[type].splice(i, 1);
                    } else if (firstType == "sample") {
                        this.sampleParmsList[type].splice(i, 1);
                    } else if (firstType == "exit") {
                        this.exitParmsList[type].splice(i, 1);
                    }
                }
            },
            download: function (attachId, fileName) {
                downloadFile(attachId, fileName)
                return false;
            },
            changelogistics: function (sampleId) {
                $.dialog({
                    content: 'url:logistic.html?sampleId=' + sampleId,
                    title: '更改物流信息',
                    width: 904,
                    height: 535,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            fjStyle: function (fjName) {
                if (fjName) {
                    var type = fjName.substring(fjName.lastIndexOf('.') + 1);
                    return 'img fj-' + type
                }
                return 'img'
            },
            init: function () {
                var that = this
                setTimeout(function () {
                    $(".fj").each(function () {
                        var demo = $(this);
                        var name = demo.attr("id");
                        var nameValue = name + "Name";
                        var uploader = WebUploader.create({
                            // 选完文件后，是否自动上传。
                            auto: true,
                            // swf文件路径
                            swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                            // 文件接收服务端。
                            server: server.fjIp + "/attach/uploadFile.json",
                            // 选择文件的按钮。可选。
                            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                            pick: '#' + demo.attr("id"),
                            duplicate: true
                        });
                        // 文件上传过程中创建进度条实时显示。
                        uploader.on('uploadProgress', function (file, percentage) {
                            var $li = $('#' + file.id),
                                $percent = $li.find('.progress span');
                            // 避免重复创建
                            if (!$percent.length) {
                                $percent = $('<p class="progress"><span></span></p>')
                                    .appendTo($li)
                                    .find('span');
                            }
                            $percent.css('width', percentage * 100 + '%');
                        });
                        uploader.on("uploadStart", function () {
                            $("#progress").show();
                        });
                        uploader.on("uploadComplete", function () {
                            $("#progress").hide();
                        });
                        // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                        uploader.on('uploadSuccess', function (file, response) {
                            console.log(file)
                            console.log(response)
                            if (name.substring(0, name.length - 1) == 'repaymentCertificateAttach') {
                                var i = name.substring(name.length - 1, name.length)
                                that.RepaymentPlanList[i].repaymentCertificateAttachName = response.name;
                                that.RepaymentPlanList[i].repaymentCertificateAttachUrl = response.url;
                                $("#" + "repaymentCertificateAttach" + i).hide();
                            } else if (name == 'certificates') {
                                that.sampleParmsList.certificates.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'devicePictures') {
                                that.sampleParmsList.devicePictures.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'drayPictures') {
                                that.sampleParmsList.drayPictures.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'outdrayPictures') {
                                that.outboundParmsList.drayPictures.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'outdevicePictures') {
                                that.outboundParmsList.devicePictures.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'outcertificates') {
                                that.outboundParmsList.certificates.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'movedrayPictures') {
                                that.moveParmsList.drayPictures.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'movedevicePictures') {
                                that.moveParmsList.devicePictures.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'movecertificates') {
                                that.moveParmsList.certificates.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'exitcertificates') {
                                that.exitParmsList.certificates.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else if (name == 'exitdevicePictures') {
                                that.exitParmsList.devicePictures.push({
                                    id: response.id,
                                    name: response.name,
                                    url: response.url
                                });
                            } else {
                                var nameValue = name + "Name";
                                var urlValue = name + "Url";
                                that.sampleParmsList.main[nameValue] = response.name;
                                that.sampleParmsList.main[urlValue] = response.url;
                                $("#" + name).hide();
                            }
                        });
                        // 文件上传失败，显示上传出错。
                        uploader.on('uploadError', function (file) {
                            alert("上传失败！");
                        });
                    });
                    that.hide()
                }, 500);

            },
            hide: function () {
                var that = this;
                setTimeout(function () {
                    for (var i = 0; i < that.RepaymentPlanList.length; i++) {
                        if (that.RepaymentPlanList[i].repaymentCertificateAttachName != null && that.RepaymentPlanList[i].repaymentCertificateAttachName != "" && that.RepaymentPlanList[i].repaymentCertificateAttachName != undefined) {
                            $("#" + "repaymentCertificateAttach" + i).hide();
                        }
                    }
                    if (that.sampleParmsList.main.invoiceAttachName) {
                        $("#invoiceAttach").hide();
                    }
                    if (that.sampleParmsList.main.certificationAttachName) {
                        $("#certificationAttach").hide();
                    }
                })
            },
            /*添加一行*/
            addRow: function (type) {
                var that = this
                if (type == 'part') {
                    this.deviceParts.push(new Template.deviceParts('1'));
                    var num = that.deviceParts.length - 1;
                    that.deviceParts[num].partsPrice = 0;
                } else {
                    this.RepaymentPlanList.push(new Template.RepaymentPlan('1'));
                    var num = that.RepaymentPlanList.length - 1;
                    that.RepaymentPlanList[num].expirationMoney = 0;
                    that.RepaymentPlanList[num].paymentMoney = 0;
                    setTimeout(function () {
                        var uploader = WebUploader.create({
                            // 选完文件后，是否自动上传。
                            auto: true,
                            // swf文件路径
                            swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                            // 文件接收服务端。
                            server: server.fjIp + "/attach/uploadFile.json",
                            // 选择文件的按钮。可选。
                            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                            pick: '#repaymentCertificateAttach' + num,
                            duplicate: true
                        });
                        // 文件上传过程中创建进度条实时显示。
                        uploader.on('uploadProgress', function (file, percentage) {
                            var $li = $('#' + file.id),
                                $percent = $li.find('.progress span');
                            // 避免重复创建
                            if (!$percent.length) {
                                $percent = $('<p class="progress"><span></span></p>')
                                    .appendTo($li)
                                    .find('span');
                            }
                            $percent.css('width', percentage * 100 + '%');
                        });
                        uploader.on("uploadStart", function () {
                            $("#progress").show();
                        });
                        uploader.on("uploadComplete", function () {
                            $("#progress").hide();
                        });
                        // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                        uploader.on('uploadSuccess', function (file, response) {
                            that.RepaymentPlanList[num].repaymentCertificateAttachName = response.name;
                            that.RepaymentPlanList[num].repaymentCertificateAttachUrl = response.url;
                            $("#" + "repaymentCertificateAttach" + num).hide();
                        });
                        // 文件上传失败，显示上传出错。
                        uploader.on('uploadError', function (file) {
                            alert("上传失败！");
                        });
                    }, 10);
                }
            },
            /*删除一行*/
            delRow: function (type) {
                if (type == 'part') {
                    this.deviceParts.splice(this.deviceParts.length - 1, 1);
                } else {
                    this.RepaymentPlanList.splice(this.RepaymentPlanList.length - 1, 1);
                }

            },
            //获取合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number = number + Number((arr[i][key] ? arr[i][key] : 0))
                }
                return number;
            },
            /*点击合计触发*/
            total: function () {
                var that = this;
                that.RepaymentPlanNum.repaymentAmountCount = that.getCount(that.RepaymentPlanList, "repaymentAmount");
                that.RepaymentPlanNum.interestCount = that.getCount(that.RepaymentPlanList, "interest");
                that.RepaymentPlanNum.actualRepaymentAmountCount = that.getCount(that.RepaymentPlanList, "actualRepaymentAmount");
                that.RepaymentPlanNum.remainingArrearsCount = that.getCount(that.RepaymentPlanList, "remainingArrears");
            },
            /*下载还款计划表附件*/
            downloadRP: function (attachId, fileName, i) {
                downloadFile(attachId, fileName)
                return false;
            }, /*删除还款计划表附件*/
            deleteFileRP: function (item, i) {
                if (window.confirm("确定要删除该附件吗?")) {
                    this.RepaymentPlanList[i].repaymentCertificateAttachName = "";
                    this.RepaymentPlanList[i].repaymentCertificateAttachUrl = "";
                    $("#" + item + i).show();
                }
            },
            /*删除附件*/
            deleteFile: function (item) {
                if (window.confirm("确定要删除该附件吗?")) {
                    this.sampleParmsList.main[item + "Name"] = "";
                    this.sampleParmsList.main[item + "Url"] = "";
                    $("#" + item).show();
                    console.log(item)
                }
            },
            /*入库*/
            addSample: function (type) {
                var that = this;
                that.sampleParmsList.main.brandName = $("#testBran option:selected").text(),
                    that.sampleParmsList.main.deviceTypeName = $("#testType option:selected").text(),
                    that.sampleParmsList.main.companyName = $("#testCom option:selected").text(),
                    that.sampleParmsList.main.modelName = $("#testMod option:selected").text(),
                    /*allModelName=$("#testMod option:selected").text();
                     m=allModelName.split(" ");
                     that.sampleParmsList.main.modelName =m[0];
                     that.sampleParmsList.main.tonConfig=m[1];*/
                    that.sampleParmsList.main.state = $("#testState option:selected").text(),
                    that.sampleParmsList.main.storeAddress = $("#testStock option:selected").text(),
                    that.sampleParmsList.main.bucketCapacity = $("#testBucketCapacity option:selected").text(),
                    that.sampleParmsList.main.bucketType = $("#testBucketType option:selected").text(),
                    that.sampleParmsList.main.payment = $("#testPayment option:selected").text(),
                    that.sampleParmsList.main.paymentStatus = $("#testStatus option:selected").text(),
                    that.sampleParmsList.main.fkCompanyId = that.selectCom;
                that.sampleParmsList.main.fkBrandId = that.selectBran;
                that.sampleParmsList.main.fkDeviceTypeId = that.selectType;
                that.sampleParmsList.main.fkModelId = that.selectMod;
                that.sampleParmsList.main.createUserId = getCurrentUser().id;
                that.sampleParmsList.main.createUserName = getCurrentUser().name;
                if (type == "draft") {
                    that.sampleParmsList.main.auditFlag = "-1";
                } else {
                    that.sampleParmsList.main.auditFlag = "0";
                    //that.sampleParmsList.main.auditFlag = "1";
                }
                if (that.sampleParmsList.main.companyName == "购车公司" || that.sampleParmsList.main.companyName == "") {
                    alert("请选择购车公司");
                    return false;
                }
                if (that.sampleParmsList.main.brandName == "请选择品牌" || that.sampleParmsList.main.brandName == "") {
                    alert("请选择品牌");
                    return false;
                }
                if (that.sampleParmsList.main.deviceTypeName == "请选择设备类型" || that.sampleParmsList.main.deviceTypeName == "") {
                    alert("请选择设备类型");
                    return false;
                }

                if (that.sampleParmsList.main.modelName == "请选择型号" || that.sampleParmsList.main.modelName == "") {
                    alert("请选择型号");
                    return false;
                }
                if (that.sampleParmsList.main.state == "请选择状态" || that.sampleParmsList.main.state == "") {
                    alert("请选择状态");
                    return false;
                }
                if (that.sampleParmsList.main.sequence == null || that.sampleParmsList.main.sequence == "") {
                    alert("请输入序列号");
                    return false;
                }
                /*if (that.sampleParmsList.main.tonConfig == null || that.sampleParmsList.main.tonConfig == "") {
                 alert("请输入吨位");
                 return false;
                 }*/
                if (that.sampleParmsList.main.pickUpDate == null || that.sampleParmsList.main.pickUpDate == "") {
                    alert("请输入提货日期");
                    return false;
                }
                // if (that.sampleParmsList.main.storeAddress=="请选择库存地"||that.sampleParmsList.main.storeAddress =="") {
                //     that.sampleParmsList.main.storeAddress="-";
                // }
                /*if (that.sampleParmsList.main.bucketType=="请选择状态"||that.sampleParmsList.main.bucketType =="") {
                 alert("请选择铲斗配置");
                 return false;
                 }
                 */
                if (that.sampleParmsList.main.pickupPrice == "") {
                    that.sampleParmsList.main.pickupPrice = 0;
                }
                if (that.sampleParmsList.main.financingAmount == ""){
                    that.sampleParmsList.main.financingAmount = 0;
                }
                if (that.sampleParmsList.main.partsPrice == "") {
                    that.sampleParmsList.main.partsPrice = 0;
                }
                if (that.sampleParmsList.main.specialFee == "") {
                    that.sampleParmsList.main.specialFee = 0;
                }
                if (that.sampleParmsList.main.deductionFee == "") {
                    that.sampleParmsList.main.deductionFee = 0;
                }
                if (that.sampleParmsList.main.tonConfig == "") {
                    that.sampleParmsList.main.tonConfig = 0;
                }
                //that.sampleParmsList.main.stockTime = $("#addCreateDate").val();
                $.wyui.postMethod('/deviceSample/add.json', trimRN(that.sampleParmsList), function (r) {
                    var d = r.records;
                    if (r.records == "保存失败") {
                        alert("保存失败");
                        return false;
                    } else if (r.records == "序列号已存在") {
                        alert("序列号已存在");
                        return false;
                    }
                    for (var i = 0; i < that.RepaymentPlanList.length; i++) {
                        that.RepaymentPlanList[i].sampleId = d;
                        that.RepaymentPlanList[i].updateUserId = getCurrentUser().id;
                        if (that.RepaymentPlanList[i].expirationMoney == "") {
                            that.RepaymentPlanList[i].expirationMoney = 0;
                        }
                        if (that.RepaymentPlanList[i].paymentMoney == "") {
                            that.RepaymentPlanList[i].paymentMoney = 0;
                        }
                    }
                    for (var i = 0; i < that.deviceParts.length; i++) {
                        that.deviceParts[i].sampleId = d;
                        that.deviceParts[i].updateUserId = getCurrentUser().id;
                    }
                    $.wyui.postMethod('/deviceSample/addDevicePartsRecords.json', trimRN(that.deviceParts), function (r) {
                    });

                    $.wyui.postMethod('/deviceSample/addRepaymentPlan.json', trimRN(that.RepaymentPlanList), function (r) {
                        if (r.records != '保存失败') {
                            alert("保存成功")
                            var pageId = top.getActivePageId();
                            var $iframe = top.findIframeByName("库存管理");
                            $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.app.sel();
                            top.closeTabByPageId(pageId);
                            /* var $iframe = top.findIframeByName("库存管理");
                             $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.app.sel();
                             api.close();*/
                        } else {
                            alert("入库失败");
                        }
                    });
                });
            },
            /*保存修改*/
            update: function (type) {
                var that = this;
                /*that.sampleParmsList.main.brandName = $("#testBran option:selected").text(),
                 that.sampleParmsList.main.deviceTypeName = $("#testType option:selected").text(),
                 that.sampleParmsList.main.companyName = $("#testCom option:selected").text(),
                 */
                 that.sampleParmsList.main.storeAddress = $("#testStock option:selected").text(),
                that.sampleParmsList.main.modelName = $("#testMod option:selected").text();
                that.sampleParmsList.main.bucketType = $("#testBucketType option:selected").text();
                that.sampleParmsList.main.bucketCapacity = $("#testBucketCapacity option:selected").text();
                that.sampleParmsList.main.state = $("#testState option:selected").text();
                that.sampleParmsList.main.payment = $("#testPayment option:selected").text();
                /* that.sampleParmsList.main.paymentStatus = $("#testStatus option:selected").text(),
                 that.sampleParmsList.main.fkCompanyId = that.selectCom;
                 that.sampleParmsList.main.fkBrandId = that.selectBran;
                 that.sampleParmsList.main.fkDeviceTypeId = that.selectType;
                 that.sampleParmsList.main.fkModelId = that.selectMod;*/

                if (that.sampleParmsList.main.companyName == "购车公司" || that.sampleParmsList.main.companyName == "") {
                    alert("请选择购车公司");
                    return false;
                }
                if (that.sampleParmsList.main.brandName == "请选择品牌" || that.sampleParmsList.main.brandName == "") {
                    alert("请选择品牌");
                    return false;
                }
                if (that.sampleParmsList.main.deviceTypeName == "请选择设备类型" || that.sampleParmsList.main.deviceTypeName == "") {
                    alert("请选择设备类型");
                    return false;
                }
                if (that.sampleParmsList.main.modelName == "请选择型号" || that.sampleParmsList.main.modelName == "") {
                    alert("请选择型号");
                    return false;
                }
                if (that.sampleParmsList.main.state == "请选择状态" || that.sampleParmsList.main.state == "") {
                    alert("请选择状态");
                    return false;
                }
                // if (that.sampleParmsList.main.storeAddress=="请选择库存地"||that.sampleParmsList.main.storeAddress =="") {
                //     alert("请选择库存地");
                //     return false;
                // }
                /*if (that.sampleParmsList.main.bucketType=="请选择状态"||that.sampleParmsList.main.bucketType =="") {
                 alert("请选择铲斗配置");
                 return false;
                 }*/
                if (that.sampleParmsList.main.sequence == null || that.sampleParmsList.main.sequence == "") {
                    alert("请选择序列号");
                    return false;
                }
                for (var i = 0; i < that.RepaymentPlanList.length; i++) {
                    var d = $.wyui.page.urlParams.id;
                    delete that.RepaymentPlanList[i].id;
                    that.RepaymentPlanList[i].sampleId = d;
                    that.RepaymentPlanList[i].updateUserId = getCurrentUser().id;
                }
                for (var i = 0; i < that.deviceParts.length; i++) {
                    var d = $.wyui.page.urlParams.id;
                    delete that.deviceParts[i].id;
                    that.deviceParts[i].sampleId = d;
                    that.deviceParts[i].updateUserId = getCurrentUser().id;
                }
                that.sampleParmsList.main.state = that.selectState;
                that.sampleParmsList.main.updateUserId = getCurrentUser().id;
                that.sampleParmsList.main.updateUserName = getCurrentUser().name;
                if (type == 'add') {
                    that.sampleParmsList.main.auditFlag = "0";
                } else if (that.sampleParmsList.main.auditFlag == -1) {
                    that.sampleParmsList.main.auditFlag = "-1";
                } else {
                    that.sampleParmsList.main.auditFlag = "1";
                }
                // that.sampleParmsList.main.auditFlag = "1";
                if (that.sampleParmsList.main.state == "已交" && (that.sampleParmsList.main.actualDeliveryDate == "" || that.sampleParmsList.main.actualDeliveryDate == null)) {
                    alert("请选择实际交车日期");
                    return false;
                }
                if (that.outboundParmsList.main.id != "" && that.outboundParmsList.main.id != undefined) {
                    $.wyui.postMethod('/devicelogistics/updateOutRecord.json', trimRN(that.outboundParmsList), function (r) {
                    });
                }
                if (that.moveParmsList.main.id != "" && that.moveParmsList.main.id != undefined) {
                    $.wyui.postMethod('/devicelogistics/updateMoveRecord.json', trimRN(that.moveParmsList), function (r) {
                    });
                }
                if (that.exitParmsList.main.id != "" && that.exitParmsList.main.id != undefined) {
                    $.wyui.postMethod('/devicelogistics/updateExitRecord.json', trimRN(that.exitParmsList), function (r) {
                    });
                }
                if (that.sampleParmsList.main.storeAddress == "直发客户交机" && that.sampleParmsList.main.state == '已交' && that.sampleParmsList.main.picture == "") {
                    that.sampleParmsList.main.picture = $("#contractId").val()
                }

                if (that.sampleParmsList.main.storeAddress == "直发客户交机" && that.sampleParmsList.main.state == '已交' && that.sampleParmsList.main.picture == "" && that.outboundParmsList.main.id == "") {
                    alert("请选择合同")
                    return false;
                }
                $.wyui.postMethod('/deviceSample/updateSample.json', trimRN(that.sampleParmsList), function (r) {
                    if (r.records == '保存成功') {
                        $.wyui.postMethod('/deviceSample/updateRepaymentPlan.json', trimRN(that.RepaymentPlanList), function (r) {
                            if (that.oldState == "交付在途" && that.sampleParmsList.main.state == "已交") {
                                $.wyui.postMethod('/regionAchivementsService/deliveryCountMoney.json', {sampleId: that.sampleParmsList.main.id}, function (data) {
                                    //实时绩效奖惩金额
                                }, true);
                            }
                            $.wyui.postMethod('/deviceSample/addDevicePartsRecords.json', trimRN(that.deviceParts), function (r) {

                            }, true);
                            alert("保存成功");
                            var pageId = top.getActivePageId();
                            var $iframe = top.findIframeByName("库存管理");
                            $iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.app.sel();
                            top.closeTabByPageId(pageId);

                            //var $iframe = top.findIframeByName("库存管理");
                            //$iframe[0].contentWindow.$("#iframeBox")[0].contentWindow.app.sel();
                            //api.close();
                        });
                    } else {
                        alert("保存失败");
                    }
                });
            },
            //获取日志
            getMoreHistory: function () {
                var that = this;
                $(".moreList").each(function () {
                    console.log($(this));
                    var demo = $(this);
                    var tableName = $(this).attr("data-table");
                    var type = $(this).attr("data-type");
                    if (type == '1') {
                        var columnName = $(this).attr("data-column");
                        $.wyui.postMethod("/logs/getColumnLogsNum.json", {
                            "tableName": tableName,
                            "columnName": columnName,
                            "updateId": that.sampleParmsList.main.id
                        }, function (data) {
                            console.log(data)
                            if (data.result) {
                                var p = new Array();
                                p.push("<i></i>");
                                demo.addClass("jiaobiao3");
                                if (that.showToday(data.updateTime)) {
                                    demo.children("span").css("color", "#ff0000");
                                }
                                demo.append(p.join(""))
                            }
                        })
                    } else if (type == "2") {
                        var columnName = $(this).attr("data-columnName");
                        var mainKey = $(this).attr("data-column");
                        var mid = $(this).attr("data-mid");
                        $.wyui.postMethod("/logs/getTableLogsNum.json", {
                            "tableName": tableName,
                            "columnName": columnName,
                            "mainKey": mainKey,
                            "id": mid
                        }, function (data) {
                            console.log(data)
                            if (data.result) {
                                var p = new Array();
                                p.push("<i></i>");
                                demo.addClass("jiaobiao3");
                                if (that.showToday(data.updateTime)) {
                                    demo.children("span").css("color", "#ff0000");
                                }
                                demo.append(p.join(""))
                            }
                        })
                    }
                })
            },
        },
        mounted: function () {
            //页面操作状态
            this.pageType = $.wyui.page.urlParams.pageType;
            var that = this;
            //上传附件
            that.sampleParmsList.main.id = $.wyui.page.urlParams.id;
            $.wyui.postMethod('/enum2/selectByModuleType.json', {"moduleType": "payType"}, function (data) {
                that.payment = data;
            });
            $.wyui.postMethod('/enum2/selectByModuleType.json', {"moduleType": "paymentSituation"}, function (data) {
                that.paymentSituation = data;
            });
            $.wyui.postMethod('/intentCustomer/getForProvinceById.json', {'id': '0'}, function (r) {
                that.itemPro = r.records;
            })

            if ($.wyui.page.urlParams.pageType == "edit") {
                that.beforeshow();
                that.beforeshow2();
                var data = {'id': $.wyui.page.urlParams.id}
                /*获取提货公司下拉列表*/
                $.wyui.postMethod('/company/getCompanyByUserId.json', {userId: that.userId}, function (r) {
                    that.itemsCom = r;
                });
                $.wyui.postMethod('/deviceSample/getSampleAndRepaymentById.json', data, function (r) {
                    that.sampleParmsList.main = r.sampleList;
                    that.storeDuration = that.sampleParmsList.main.storeDuration;
                    that.selectBucketType=that.sampleParmsList.main.bucketType;
                    that.selectBucketCapacity=that.sampleParmsList.main.bucketCapacity;
                    if (that.sampleParmsList.main.namePlateAttachName != null && that.sampleParmsList.main.namePlateAttachName != "" && that.sampleParmsList.main.namePlateAttachName != undefined) {
                        $("#namePlateAttach").hide();
                    }
                    if (that.sampleParmsList.main.driverAttachName != null && that.sampleParmsList.main.driverAttachName != "" && that.sampleParmsList.main.driverAttachName != undefined) {
                        $("#driverAttach").hide();
                    }
                    if (that.sampleParmsList.main.partsAttachName != null && that.sampleParmsList.main.partsAttachName != "" && that.sampleParmsList.main.partsAttachName != undefined) {
                        $("#partsAttach").hide();
                    }
                    //that.auditHistorys = r.auditHistory;
                    that.oldState = r.sampleList.state;
                    that.RepaymentPlanList = r.RepaymentPlanList;
                    that.deviceParts = r.deviceParts;
                    if (that.deviceParts.length == 0) {
                        that.deviceParts.push({partsPrice: 0}, {partsPrice: 0}, {partsPrice: 0});
                    }
                    that.sampleParmsList.attaches = r.attaches;
                    that.sampleParmsList.certificates = r.certificates;
                    that.sampleParmsList.devicePictures = r.devicePictures;
                    that.sampleParmsList.drayPictures = r.drayPictures;
                    /*下来框初始值*/
                    that.selectType = r.sampleList.fkDeviceTypeId;
                    that.selectBran = r.sampleList.fkBrandId;
                    that.selectMod = r.sampleList.fkModelId;
                    that.selectState = that.sampleParmsList.main.state;
                    that.selectCom = that.sampleParmsList.main.fkCompanyId;
                    /*if (that.sampleParmsList.main.state.indexOf('在途') != -1) {
                     that.selectStock = '';
                     } else {
                     that.selectStock = that.sampleParmsList.main.storeAddress;
                     }*/
                    that.selectStock = that.sampleParmsList.main.storeAddress;
                    that.selectBucketType = that.sampleParmsList.main.bucketType;
                    that.selectBucketCapacity = that.sampleParmsList.main.bucketCapacity;
                    that.selectStatus = that.sampleParmsList.main.paymentStatus;
                    that.selectPayment = that.sampleParmsList.main.payment;
                    $.wyui.postMethod('/company/getCompanyById.json', {id: that.selectCom}, function (r) {
                        that.stocks = r.stock;
                    }, true)
                    if (that.sampleParmsList.main.state == "提车在途") {
                        that.state = [
                            {value: '未发订单'},
                            {value: '提车在途'},
                            {value: '库存'},
                            {value: '寄存'}
                        ]
                    } else if (that.sampleParmsList.main.state == "库存") {
                        that.state = [
                            {value: '未发订单'},
                            {value: '库存'},
                            {value: '寄存'}
                        ]
                    } else if (that.sampleParmsList.main.state == "寄存") {
                        that.state = [
                            {value: '未发订单'},
                            {value: '寄存'},
                            {value: '库存'}
                        ]
                    } else if (that.sampleParmsList.main.state == "交付在途" && that.sampleParmsList.main.auditFlag != 2) {
                        that.state = [
                            {value: '未发订单'},
                            {value: '已交'},
                            {value: '交付在途'},
                        ]
                    } else if (that.sampleParmsList.main.state == "移库在途") {
                        that.state = [
                            {value: '未发订单'},
                            {value: '库存'},
                            {value: '寄存'},
                            {value: '移库在途'},
                        ]
                    } else if (that.sampleParmsList.main.state == "退货在途") {
                        that.state = [
                            {value: '退货在途'},
                            {value: '已退货'},
                            {value: '库存'},
                            {value: '寄存'},
                        ]
                    } else {
                        that.state = [
                            {value: that.sampleParmsList.main.state},
                        ]
                    }
                    $.wyui.postMethod('/deviceBrand/getBankAndAccount.json', {brandId: that.selectBran}, function (data) {
                        that.payees = data;
                    });
                    that.showBucket();
                    if (r.logistics.id != undefined) {
                        that.logisticParmsList.main = r.logistics;
                        that.logisticParmsList.certificates = r.lcertificates;
                        that.logisticParmsList.devicePictures = r.ldevicePictures;
                        that.logisticParmsList.drayPictures = r.ldrayPictures;
                        $("#logistics").show();
                        $("#logisticTime").show()
                    }
                    if (r.outBoundrecord.id != undefined) {
                        that.outboundParmsList.main = r.outBoundrecord;
                        that.outboundParmsList.certificates = r.outcertificates;
                        that.outboundParmsList.devicePictures = r.outdevicePictures;
                        that.outboundParmsList.drayPictures = r.outdrayPictures;
                        that.contract = r.outBoundrecord.contract;
                        $("#outbound").show();
                        $("#outboundTime").show();
                    } else {
                        $("#outbound").hide();
                    }
                    if (r.exitBoundrecord.id != undefined) {
                        that.exitParmsList.main = r.exitBoundrecord;
                        that.exitParmsList.certificates = r.exitcertificates;
                        that.exitParmsList.devicePictures = r.exitdevicePictures;
                        that.exitParmsList.drayPictures = r.exitdrayPictures;
                        $("#exit").show();
                        $("#exitTime").show();
                    } else {
                        $("#exit").hide();
                    }
                    if (r.moveBoundrecord.id != undefined) {
                        that.moveParmsList.main = r.moveBoundrecord;
                        that.moveParmsList.certificates = r.movecertificates;
                        that.moveParmsList.devicePictures = r.movedevicePictures;
                        that.moveParmsList.drayPictures = r.movedrayPictures;
                        var a = {
                            companyId: that.sampleParmsList.main.fkCompanyId,
                            contact: r.moveBoundrecord.deliveryContacts,
                            contactTel: r.moveBoundrecord.deliveryTelephone,
                            id: "2018071811124565A12BFF5E688284E1",
                            sortNo: 0,
                            stockArea: r.moveBoundrecord.delivery_address,
                        };
                        that.stocks.push(a);
                        $("#move").show();
                        $("#moveTime").show();
                    } else {
                        $("#move").hide();
                    }
                    if (that.sampleParmsList.main.deviceTypeName.indexOf("挖掘机") >= 0 | that.sampleParmsList.main.deviceTypeName.indexOf("装载机") >= 0) {
                        $("#wjj").show();
                        $("td[name='psc']").hide();
                        $("td[name='sfj']").hide();
                    } else if (that.sampleParmsList.main.deviceTypeName.indexOf("破碎锤") >= 0) {
                        $("#wjj").hide();
                        $("td[name='sfj']").hide();
                        $("td[name='psc']").show();
                    } else if (that.sampleParmsList.main.deviceTypeName.indexOf("筛分机") >= 0 | that.sampleParmsList.main.deviceTypeName.indexOf("破碎机") >= 0) {
                        $("td[name='sfj']").show();
                        $("td[name='psc']").hide();
                        $("#wjj").hide();
                    }
                    $.wyui.postMethod('/deviceSample/selectBucketListByModelId.json', {modelId: that.selectMod}, function (r) {
                        that.buckets = r;
                    })
                    $.wyui.postMethod('/deviceBrand/getBrandByCompanyId.json', {'companyId': that.selectCom}, function (r) {
                        that.itemsBran = r.brands;
                    })
                    $.wyui.postMethod('/deviceBrand/getDeviceTypeList.json', {
                        'companyId': that.selectCom,
                        'brandId': that.selectBran
                    }, function (r) {
                        that.itemsType = r.devicetypes;
                    });
                    $.wyui.postMethod('/brandStrock/selectByBrandId.json', {
                        brandId: that.selectBran,
                        type: 'distinct'
                    }, function (data) {
                        that.factorys = data;
                    });
                    if (that.sampleParmsList.main.trafficStarting != "") {
                        $.wyui.postMethod('/brandStrock/getContactsByAddress.json', {address: that.sampleParmsList.main.trafficStarting}, function (data) {
                            that.factoryContacts = data;
                        });
                    }
                    var data = {'brandId': that.selectBran, 'deviceTypeId': that.selectType};
                    $.wyui.postMethod('/deviceModel/getModelListByBrandId.json', data, function (r) {
                        that.itemsMod = r.models;
                    })
                    that.init();//初始化还款计划表上传附件样式
                });


                if (that.sampleParmsList.main.certificationAttachName != null && that.sampleParmsList.main.certificationAttachName != "" && that.sampleParmsList.main.certificationAttachName != undefined) {
                    $("#certificationAttach").hide();
                }
                if (that.sampleParmsList.main.invoiceAttachName != null && that.sampleParmsList.main.invoiceAttachName != "" && that.sampleParmsList.main.invoiceAttachName != undefined) {
                    $("#invoiceAttach").hide();
                }
                this.uploader = WebUploader.create({
                    // 选完文件后，是否自动上传。
                    auto: true,
                    // swf文件路径
                    swf: "/statics/plugin/webuploader-0.1.5/Uploader.swf",
                    // 文件接收服务端。
                    //server: server.fjIp + "/attach/uploadFile.json",
                    server: "http://39.106.135.205/jsyf-oa/attach/uploadFile.json",
                    // 选择文件的按钮。可选。
                    // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                    pick: '#divUpload',
                    duplicate: true
                });
                this.uploader.on("uploadStart", function () {
                    $("#progress").show();

                });
                this.uploader.on("uploadComplete", function () {
                    $("#progress").hide();
                });
                // 文件上传成功，给item添加成功class, 用样式标记上传成功。
                this.uploader.on('uploadSuccess', function (file, response) {
                    if (response._raw == "文件上传出错！") {
                        alert("文件上传出错！");
                    } else {
                        that.sampleParmsList.attaches.push({
                            id: response.id,
                            name: response.name,
                            url: response.url
                        });
                    }
                });
                // 文件上传失败，显示上传出错。
                this.uploader.on('uploadError', function (file) {
                    alert("上传失败！");
                });
            } else if ($.wyui.page.urlParams.pageType == "look") {
                var that = this;
                $("td[name='storeTime']").show();
                $.wyui.postMethod('/deviceSample/getSampleById.json', {id: $.wyui.page.urlParams.id}, function (r) {
                    that.sampleParmsList.main = r.sampleParmsList;
                    that.storeDuration = that.sampleParmsList.main.storeDuration;
                    //that.auditHistorys = r.auditHistory;
                    that.RepaymentPlanList = r.repaymentPlanList;
                    that.deviceParts = r.deviceParts;
                    if (that.deviceParts.length == 0) {
                        that.deviceParts.push({partsPrice: 0}, {partsPrice: 0}, {partsPrice: 0});
                    }
                    that.sampleParmsList.bucketConditon = r.bucketType;
                    that.sampleParmsList.attaches = r.attaches;
                    that.sampleParmsList.certificates = r.certificates;
                    that.sampleParmsList.devicePictures = r.devicePictures;
                    that.sampleParmsList.drayPictures = r.drayPictures;
                    that.selectBran = r.sampleParmsList.fkBrandId;
                    $.wyui.postMethod('/deviceBrand/getBankAndAccount.json', {brandId: that.selectBran}, function (data) {
                        that.payees = data;
                    });
                    if (r.logistics.id != undefined) {
                        that.logisticParmsList.main = r.logistics;
                        that.logisticParmsList.certificates = r.lcertificates;
                        that.logisticParmsList.devicePictures = r.ldevicePictures;
                        that.logisticParmsList.drayPictures = r.ldrayPictures;
                        $("#logistics").show();
                        $("#logisticTime").show()
                    }
                    if (r.outBoundrecord.id != undefined) {
                        that.outboundParmsList.main = r.outBoundrecord;
                        that.outboundParmsList.certificates = r.outcertificates;
                        that.outboundParmsList.devicePictures = r.outdevicePictures;
                        that.outboundParmsList.drayPictures = r.outdrayPictures;
                        that.contract = r.outBoundrecord.contract;
                        $("#outbound").show();
                        $("#outboundTime").show();
                    } else {
                        $("#outbound").hide();
                    }
                    if (r.exitBoundrecord.id != undefined) {
                        that.exitParmsList.main = r.exitBoundrecord;
                        that.exitParmsList.certificates = r.exitcertificates;
                        that.exitParmsList.devicePictures = r.exitdevicePictures;
                        that.exitParmsList.drayPictures = r.exitdrayPictures;
                        $("#exit").show();
                        $("#exitTime").show();
                    } else {
                        $("#exit").hide();
                    }
                    if (r.moveBoundrecord.id != undefined) {
                        that.moveParmsList.main = r.moveBoundrecord;
                        that.moveParmsList.certificates = r.movecertificates;
                        that.moveParmsList.devicePictures = r.movedevicePictures;
                        that.moveParmsList.drayPictures = r.movedrayPictures;
                        $("#move").show();
                        $("#moveTime").show();
                    } else {
                        $("#move").hide();
                    }
                    if (r.sampleParmsList.deviceTypeName == "挖掘机" | r.sampleParmsList.deviceTypeName == "装载机") {
                        $("#wjj").show();
                        $("td[name='psc']").hide();
                        $("td[name='sfj']").hide();
                    } else if (r.sampleParmsList.deviceTypeName == "破碎锤") {
                        $("#wjj").hide();
                        $("td[name='sfj']").hide();
                        $("td[name='psc']").show();
                    } else if (r.sampleParmsList.deviceTypeName == "筛分机" | r.sampleParmsList.deviceTypeName == "破碎机") {
                        $("td[name='sfj']").show();
                        $("td[name='psc']").hide();
                        $("#wjj").hide();
                    }
                    if (that.sampleParmsList.main.certificationAttachName != null && that.sampleParmsList.main.certificationAttachName != "" && that.sampleParmsList.main.certificationAttachName != undefined) {
                        $("#certificationAttach").hide();
                    }

                    if (that.sampleParmsList.main.invoiceAttachName != null && that.sampleParmsList.main.invoiceAttachName != "" && that.sampleParmsList.main.invoiceAttachName != undefined) {
                        $("#invoiceAttach").hide();
                    }
                    for (var i = 0; i < that.RepaymentPlanList.length; i++) {
                        if (that.RepaymentPlanList[i].repaymentCertificateAttachName != null && that.RepaymentPlanList[i].repaymentCertificateAttachName != "" && that.RepaymentPlanList[i].repaymentCertificateAttachName != undefined) {
                            $("#" + "repaymentCertificateAttach" + i).hide();
                        }
                    }
                    that.init();
                    that.getMoreHistory();
                });
            } else {
                that.deviceParts.push({partsPrice: 0}, {partsPrice: 0}, {partsPrice: 0});
                $("#traCompany").autoComplete({
                    url: server.ip + "/brandStrock/getTransportCompany.json",
                    render: function (users, panel) {
                        for (var i = 0; i < users.length; i++) {
                            $("<li></li>").data("autoComplete",
                                users[i]).html("<a>" + users[i].companyName + "&nbsp;&nbsp;&nbsp;" +
                                "(" + "&nbsp;" + users[i].contact + "-" + users[i].tel + "&nbsp;" + ") " + "</a>")
                                .appendTo(panel);
                        }
                    },
                    selected: function (user) {
                        app.sampleParmsList.main.transportCompany = user.companyName;
                        app.sampleParmsList.main.contacts = user.contact;
                        app.sampleParmsList.main.telephone = user.tel;
                        return false;
                    },
                    height: 210,
                    width: 320
                });
                //that.sampleParmsList.main.stockTime = new Date().Format("yyyy-MM-dd")
                $("#outbound").hide();
                $("#move").hide();
                $("#exit").hide();
                $("#addmodel").show();
                $("#addbucket").show();
                $("#pick").hide();
                $("#repayment").hide();
                $("#config").hide();
                $("#parts").hide();
                $("#transport").hide();
                $("td[name='storeTime']").hide();
                $("#wjj").hide();
                $("td[name='psc']").hide();
                $("td[name='sfj']").hide();
                $("#logistics").hide();
                var that = this;
                that.beforeshow();
                that.beforeshow2();
                that.type = "add"
                //that.init();//初始化还款计划表上传附件样式*/ 不需要 选择型号时会自动调用
                /*获取提货公司下拉列表*/
                $.wyui.postMethod('/company/getCompanyByUserId.json', {userId: that.userId}, function (r) {
                    that.itemsCom = r;
                });
                $.wyui.postMethod('/enum2/selectByModuleType.json', {"moduleType": "deviceState"}, function (data) {
                    that.state = data;
                });
                //编辑
            }
        },
        updated: function () {
            //dom更新时调用方法
        }
    });
</script>
<script>
    function refresh(id) {
        if ("close" == id) {
            //型号管理刷新父页面
            window.location.href = "/page/device/sample/detail_new.html?pageType=add";
        } else {
            window.location.href = "detail_new.html?pageType=edit&&id=" + id;
            //物流变更刷新父页面
        }
    }
</script>
<script>
    function getParam(id, contractNo, buyer) {
        $("#show").text("重新选择")
        $("#contractId").val(id);
        var msg = contractNo + "-" + buyer;
        $("#contract").text(msg);
        /* $("#selContract").hide();*/
    }
</script>
<script>
    $("#traCompany").autoComplete({
        url: server.ip + "/brandStrock/getTransportCompany.json",
        render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                $("<li></li>").data("autoComplete",
                    users[i]).html("<a>" + users[i].companyName + "&nbsp;&nbsp;&nbsp;" +
                    "(" + "&nbsp;" + users[i].contact + "-" + users[i].tel + "&nbsp;" + ") " + "</a>")
                    .appendTo(panel);
            }
        },
        selected: function (user) {
            app.sampleParmsList.main.transportCompany = user.companyName;
            app.sampleParmsList.main.contacts = user.contact;
            app.sampleParmsList.main.telephone = user.tel;
            return false;
        },
        height: 210,
        width: 320
    });
    $("#moveTraCompany").autoComplete({
        url: server.ip + "/brandStrock/getTransportCompany.json",
        render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                $("<li></li>").data("autoComplete",
                    users[i]).html("<a>" + users[i].companyName + "&nbsp;&nbsp;&nbsp;" +
                    "(" + "&nbsp;" + users[i].contact + "-" + users[i].tel + "&nbsp;" + ") " + "</a>")
                    .appendTo(panel);
            }
        },
        selected: function (user) {
            app.moveParmsList.main.transport_company = user.companyName;
            app.moveParmsList.main.contacts = user.contact;
            app.moveParmsList.main.telephone = user.tel;
            return false;
        },
        height: 210,
        width: 320
    });
    $("#outTraCompany").autoComplete({
        url: server.ip + "/brandStrock/getTransportCompany.json",
        render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                $("<li></li>").data("autoComplete",
                    users[i]).html("<a>" + users[i].companyName + "&nbsp;&nbsp;&nbsp;" +
                    "(" + "&nbsp;" + users[i].contact + "-" + users[i].tel + "&nbsp;" + ") " + "</a>")
                    .appendTo(panel);
            }
        },
        selected: function (user) {
            app.outboundParmsList.main.transport_company = user.companyName;
            app.outboundParmsList.main.contacts = user.contact;
            app.outboundParmsList.main.telephone = user.tel;
            return false;
        },
        height: 210,
        width: 320
    });
    $("#exitTraCompany").autoComplete({
        url: server.ip + "/brandStrock/getTransportCompany.json",
        render: function (users, panel) {
            for (var i = 0; i < users.length; i++) {
                $("<li></li>").data("autoComplete",
                    users[i]).html("<a>" + users[i].companyName + "&nbsp;&nbsp;&nbsp;" +
                    "(" + "&nbsp;" + users[i].contact + "-" + users[i].tel + "&nbsp;" + ") " + "</a>")
                    .appendTo(panel);
            }
        },
        selected: function (user) {
            app.exitParmsList.main.transport_company = user.companyName;
            app.exitParmsList.main.contacts = user.contact;
            app.exitParmsList.main.telephone = user.tel;
            return false;
        },
        height: 210,
        width: 320
    });
</script>
</body>
</html>